ndctl: Avoid confusing error message when operating on all the namespaces
PATCH 1/1 ndctl: Avoid confusing error message when operating on all the namespaces
With only seed namespace present, ndctl results in confusing error messages as below.
ndctl# ./ndctl/ndctl enable-namespace all error enabling namespaces: No such device or address enabled 0 namespaces
ndctl# ./ndctl/ndctl disable-namespace all
disabled 3 namespaces
ndctl# ./ndctl/ndctl destroy-namespace all -f
Error: destroy namespace: namespace1.0 failed to enable for zeroing, continuing
Error: destroy namespace: namespace1.1 failed to enable for zeroing, continuing
Error: destroy namespace: namespace0.0 failed to enable for zeroing, continuing
destroyed 0 namespaces
ndctl#
With the patch we get
ndctl# ./ndctl/ndctl disable-namespace all
disabled 0 namespaces
ndctl# ./ndctl/ndctl enable-namespace all
enabled 0 namespaces
ndctl# ./ndctl/ndctl destroy-namespace all -f
destroyed 0 namespaces
ndctl#
--- ndctl/namespace.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
ndctl/namespace.c +8 -1
@@ -2205,8 +2205,15 @@ static int do_xaction_namespace(const char *namespace,return rc; } ndctl_namespace_foreach_safe(region, ndns, _n) { - ndns_name =ndctl_namespace_get_devname (ndns); +if (!strcmp (namespace,"all" ) + && !ndctl_namespace_get_size (ndns)) { +if (!*processed && rc) + rc =0 ; +continue ; + } + + ndns_name =ndctl_namespace_get_devname (ndns);if (strcmp (namespace,"all" ) !=0 &&strcmp (namespace, ndns_name) !=0 )continue ;
Signature · 1 line
2.31.1
Jeff had posted one patch to fix similar issue
https://lore.kernel.org/linux-nvdimm/[email protected]/T/#u
Hi Dan/Visha
Could we make some progress on this issue?
Quoted 62 lines · Aneesh Kumar K.V
With only seed namespace present, ndctl results in confusing error messages as below.
ndctl# ./ndctl/ndctl enable-namespace all error enabling namespaces: No such device or address enabled 0 namespaces
ndctl# ./ndctl/ndctl disable-namespace all
disabled 3 namespacesndctl# ./ndctl/ndctl destroy-namespace all -f
Error: destroy namespace: namespace1.0 failed to enable for zeroing, continuingError: destroy namespace: namespace1.1 failed to enable for zeroing, continuing
Error: destroy namespace: namespace0.0 failed to enable for zeroing, continuing
destroyed 0 namespaces
ndctl#With the patch we get
ndctl# ./ndctl/ndctl disable-namespace all
disabled 0 namespacesndctl# ./ndctl/ndctl enable-namespace all
enabled 0 namespacesndctl# ./ndctl/ndctl destroy-namespace all -f
destroyed 0 namespaces
ndctl#Signed-off-by Aneesh Kumar K.V <[email protected]>--- ndctl/namespace.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)ndctl/namespace.c +8
-2@@ -2205,8 +2205,15 @@ static int do_xaction_namespace(const char *namespace,return rc; } ndctl_namespace_foreach_safe(region, ndns, _n) { - ndns_name =ndctl_namespace_get_devname (ndns); +if (!strcmp (namespace,"all" ) + && !ndctl_namespace_get_size (ndns)) { +if (!*processed && rc) + rc =0 ; +continue ; + } + + ndns_name =ndctl_namespace_get_devname (ndns);if (strcmp (namespace,"all" ) !=0 &&strcmp (namespace, ndns_name) !=0 )continue ; --2.31.1
Signature · 2 lines
Best Regards, Yi Zhang
Quoted 3 lines · Yi Zhang
Jeff had posted one patch to fix similar issue
https://lore.kernel.org/linux-nvdimm/[email protected]/T/#u
I missed that patch. I am wondering whether that would result in ndctl not reporting error when we use the seed namespace name directly with destroy-namespace command
Quoted 70 lines
Hi Dan/Visha
Could we make some progress on this issue?Quoted 62 lines · Aneesh Kumar K.V
With only seed namespace present, ndctl results in confusing error messages as below.
ndctl# ./ndctl/ndctl enable-namespace all error enabling namespaces: No such device or address enabled 0 namespaces
ndctl# ./ndctl/ndctl disable-namespace all
disabled 3 namespacesndctl# ./ndctl/ndctl destroy-namespace all -f
Error: destroy namespace: namespace1.0 failed to enable for zeroing, continuingError: destroy namespace: namespace1.1 failed to enable for zeroing, continuing
Error: destroy namespace: namespace0.0 failed to enable for zeroing, continuing
destroyed 0 namespaces
ndctl#With the patch we get
ndctl# ./ndctl/ndctl disable-namespace all
disabled 0 namespacesndctl# ./ndctl/ndctl enable-namespace all
enabled 0 namespacesndctl# ./ndctl/ndctl destroy-namespace all -f
destroyed 0 namespaces
ndctl#Signed-off-by Aneesh Kumar K.V <[email protected]>--- ndctl/namespace.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)ndctl/namespace.c +8
-2@@ -2205,8 +2205,15 @@ static int do_xaction_namespace(const char *namespace,return rc; } ndctl_namespace_foreach_safe(region, ndns, _n) { - ndns_name =ndctl_namespace_get_devname (ndns); +if (!strcmp (namespace,"all" ) + && !ndctl_namespace_get_size (ndns)) { +if (!*processed && rc) + rc =0 ; +continue ; + } + + ndns_name =ndctl_namespace_get_devname (ndns);if (strcmp (namespace,"all" ) !=0 &&strcmp (namespace, ndns_name) !=0 )continue ; --2.31.1
Quoted 6 lines · Yi Zhang
Jeff had posted one patch to fix similar issue
https://lore.kernel.org/linux-nvdimm/[email protected]/T/#uHi Dan/Visha
Could we make some progress on this issue?
Apologies, we had some internal administrivia to address, but are getting back to regular releases now and catching up on the backlog.
Quoted 12 lines · Dan Williams
Quoted 6 lines · Yi Zhang
Jeff had posted one patch to fix similar issue
https://lore.kernel.org/linux-nvdimm/[email protected]/T/#uHi Dan/Visha
Could we make some progress on this issue?Apologies, we had some internal administrivia to address, but are getting back to regular releases now and catching up on the backlog.
No worries, thanks for the update :)
Signature · 2 lines
Best Regards, Yi Zhang
Quoted 10 lines · Dan Williams
Quoted 6 lines · Yi Zhang
Jeff had posted one patch to fix similar issue
https://lore.kernel.org/linux-nvdimm/[email protected]/T/#uHi Dan/Visha
Could we make some progress on this issue?Apologies, we had some internal administrivia to address, but are getting back to regular releases now and catching up on the backlog.
Any update on this patch? Without this I get failures with
https://github.com/avocado-framework-tests/avocado-misc-tests/blob/master/memory/ndctl.py
because the return status is 1 for disable-namespace command with only seed namespace.
-aneesh