ndctl create-namespace doesn't walk through the regions
from lowest to highest; in this example it's going
1,3,5,0,2,4,6:
$ sudo ndctl create-namespace --verbose
ROB: parsing bus id=0 path=ndbus0
ROB: parsing region id=1 path=region1
namespace_create:770: region1: insufficient capacity size: 0 avail: 0
ROB: parsing region id=3 path=region3
namespace_create:770: region3: insufficient capacity size: 0 avail: 0
ROB: parsing region id=5 path=region5
namespace_create:770: region5: insufficient capacity size: 0 avail: 0
ROB: parsing region id=0 path=region0
namespace_create:770: region0: insufficient capacity size: 0 avail: 0
ROB: parsing region id=2 path=region2
That makes the results unpredictable.
That's from do_xaction_namespace():
ndctl_bus_foreach(ctx, bus) {
printf("ROB: parsing bus id=%d path=%s\n", ndctl_bus_get_id(bus),
ndctl_bus_get_devname(bus));
if (!util_bus_filter(bus, param.bus))
continue;
ndctl_region_foreach(bus, region) {
printf("ROB: parsing region id=%d path=%s\n", ndctl_region_get_id(region),
ndctl_region_get_devname(region));
if (!util_region_filter(region, param.region))
The same order is used for other commands like
disable-namespace and destroy-namespace.
Questions
=========
1. Could the busses and regions (anything accessed with
a _foreach() macro) be sorted in ascending order so this
and other commands are more predictable?
2. For create-namespace with no region arguments, rather than
just creating one random namespace, how about creating namespaces
on each available region?
3. The manpage suggests that "-r all" does that, but it seems to
just make every region number pass the filter in that foreach
loop (i.e., it has no effect for the create-namespace command,
which just creates one and quits).
---
Robert Elliott, HPE Persistent Memory
Show replies by date