Consider a scenario where one region is in an error state but another is
not:
# ndctl list -Ru
[
{
"dev":"region3",
"size":"127.00 GiB (136.37 GB)",
"available_size":0,
"max_available_extent":0,
"type":"pmem",
"persistence_domain":"unknown"
},
{
"dev":"region2",
"size":"127.00 GiB (136.37 GB)",
"available_size":"127.00 GiB (136.37 GB)",
"max_available_extent":"127.00 GiB (136.37 GB)",
"type":"pmem",
"iset_id":"0xba90120012b4dc",
"persistence_domain":"unknown"
}
]
# ndctl create-namespace -m devdax -v
[..]
namespace_create:887: region3: no idle namespace seed
failed to create namespace: No such device
Instead of failing when probing region3 for capacity, fallback to
region2.
# ndctl create-namespace -m devdax
{
"dev":"namespace2.0",
"mode":"devdax",
"map":"dev",
"size":"125.01 GiB (134.23 GB)",
"uuid":"c3fa7d2f-6c20-4762-9aa8-627d06275e03",
"daxregion":{
"id":2,
"size":"125.01 GiB (134.23 GB)",
"align":2097152,
"devices":[
{
"chardev":"dax2.0",
"size":"125.01 GiB (134.23 GB)"
}
]
},
"align":2097152
}
Signed-off-by: Dan Williams <[email protected]>
---
ndctl/namespace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ndctl/namespace.c b/ndctl/namespace.c
index f215f77a94e1..bbc9107c6baa 100644
--- a/ndctl/namespace.c
+++ b/ndctl/namespace.c
@@ -867,7 +867,7 @@ static int namespace_create(struct ndctl_region *region)
if (!ndns || is_namespace_active(ndns)) {
debug("%s: no %s namespace seed\n", devname,
ndns ? "idle" : "available");
- return -ENODEV;
+ return -EAGAIN;
}
rc = setup_namespace(region, ndns, &p);
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm