ndctl
ndctl copied to clipboard
'ndctl check-namespace all' should skip destroyed namespaces
OS Version: Fedora 28 (4.17.2-200.fc28.x86_64) NDCTL Version: 61.4.g08a96c6
After creating several namespaces using different modes within a region, then destroying all but one of them, I then ran 'ndctl check-namespace all' which resulted in the following error:
# ndctl check-namespace all
libndctl: ndctl_namespace_enable: namespace0.2: failed to enable
namespace0.2: namespace_check: namespace0.2: failed to enable in raw mode: No such device or address (-6)
error checking namespaces: No such device or address
The 'destroyed' namespace (namespace0.2) still appears in ndctl check-namespace <tab> and ndctli list -Ni. Forcibly destroying it doesn't remove it. Destroyed "label-less" namespaces is discussed in Issue #41 which describes why namespace0.2 is still shown. I understand the reason. We need a solid approach to completely destroy 'label-less' namespaces and/or skip them when using ndctl commands that support the 'all' option to avoid errors such as the one shown above. There's no need to operate on such namespaces.
Here's the entire config including DIMMs, Regions, and Namespaces for completeness:
# ndctl list -iNuRD
{
"dimms":[
{
"dev":"nmem0",
"id":"8089-a2-1809-00000107",
"handle":"0x1",
"phys_id":"0x1d"
}
],
"regions":[
{
"dev":"region0",
"size":"125.00 GiB (134.22 GB)",
"available_size":"105.00 GiB (112.74 GB)",
"type":"pmem",
"numa_node":0,
"iset_id":"0x97e6da9010198a22",
"mappings":[
{
"dimm":"nmem0",
"offset":"0x10000000",
"length":"0x1f40000000",
"position":0
}
],
"persistence_domain":"memory_controller",
"namespaces":[
{
"dev":"namespace0.2",
"mode":"raw",
"size":0,
"uuid":"00000000-0000-0000-0000-000000000000",
"sector_size":512,
"state":"disabled",
"numa_node":0
},
{
"dev":"namespace0.0",
"mode":"sector",
"size":"19.98 GiB (21.45 GB)",
"uuid":"8bbdac85-20d6-42a1-be50-4f9b3b92aec2",
"raw_uuid":"0375339a-ef93-4a79-bcd9-9b33a1b63292",
"sector_size":4096,
"blockdev":"pmem0s",
"name":"prod_web_db1",
"numa_node":0
}
]
}
]
}
Any update on this? We are observing a similar behavior wherever 'all' is used as a parameter in ndctl commands.
Should be fixed since v72