ndctl/namespace: Fix enable-namespace error for seed namespaces
PATCH v2 1/1 ndctl/namespace: Fix enable-namespace error for seed namespaces
'ndctl enable-namespace all' tries to enable seed namespaces too, which results in a error like
libndctl: ndctl_namespace_enable: namespace1.0: failed to enable
--- ndctl/lib/libndctl.c | 5 +++++ 1 file changed, 5 insertions(+)
ndctl/lib/libndctl.c +5 -0
@@ -4010,11 +4010,16 @@ NDCTL_EXPORT int ndctl_namespace_enable(struct ndctl_namespace *ndns)const char *devname =ndctl_namespace_get_devname (ndns);struct ndctl_ctx *ctx =ndctl_namespace_get_ctx (ndns);struct ndctl_region *region = ndns->region; +unsigned long long size =ndctl_namespace_get_size (ndns);int rc;if (ndctl_namespace_is_enabled (ndns))return 0 ; +/* Don't try to enable idle namespace (no capacity allocated) */ +if (size ==0 ) +return -ENXIO ; + rc =ndctl_bind (ctx, ndns->module, devname);/*
Signature · 4 lines
2.24.1 _______________________________________________ Linux-nvdimm mailing list -- [email protected] To unsubscribe send an email to [email protected]
Quoted 4 lines · Santosh Sivaraj
'ndctl enable-namespace all' tries to enable seed namespaces too, which results in a error like
libndctl:
ndctl_namespace_enable: namespace1.0: failed to enable
Dan/Vishal,
Will this patch be taken in the next ndctl release?
Thanks,
Santosh
Quoted 29 lines
Signed-off-by Santosh Sivaraj <[email protected]>--- ndctl/lib/libndctl.c | 5 +++++ 1 file changed, 5 insertions(+)ndctl/lib/libndctl.c +5
-0@@ -4010,11 +4010,16 @@ NDCTL_EXPORT int ndctl_namespace_enable(struct ndctl_namespace *ndns)const char *devname =ndctl_namespace_get_devname (ndns);struct ndctl_ctx *ctx =ndctl_namespace_get_ctx (ndns);struct ndctl_region *region = ndns->region; +unsigned long long size =ndctl_namespace_get_size (ndns);int rc;if (ndctl_namespace_is_enabled (ndns))return 0 ; +/* Don't try to enable idle namespace (no capacity allocated) */ +if (size ==0 ) +return -ENXIO ; + rc =ndctl_bind (ctx, ndns->module, devname);/* Signature · 1 line
2.24.1
_______________________________________________
Linux-nvdimm mailing list -- [email protected] To unsubscribe send an email to [email protected]
Quoted 11 lines · Santosh Sivaraj
Quoted 4 lines · Santosh Sivaraj
'ndctl enable-namespace all' tries to enable seed namespaces too, which results in a error like
libndctl:
ndctl_namespace_enable: namespace1.0: failed to enableDan/Vishal,
Will this patch be taken in the next ndctl release?
Thanks for the reminder. I've picked this up.
_______________________________________________
Linux-nvdimm mailing list -- [email protected] To unsubscribe send an email to [email protected]