Skip to contentSkip to conversation

ndctl: add information about size suffixes to docs

PATCH In review Ross Zwisler 2 participants 4 messages Nov 9, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ndctl: add information about size suffixes to docs

Add information about the supported size suffixes to the documentation for ndctl-create-namespace. This prevents users from doing silly things like $((32*1024*1024*1024)) on the command line when running ndctl commands.

---
 Documentation/ndctl-create-namespace.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Documentation/ndctl-create-namespace.txt +4 -2
index a2f5e5b..5b62b95 100644
@@ -79,8 +79,10 @@ OPTIONS
 -s::
 --size=::
 	For NVDIMM devices that support namespace labels, set the
-	namespace size.  Otherwise it defaults to the maximum size
-	specified by platform firmware.
+	namespace size in bytes.  Otherwise it defaults to the maximum
+	size specified by platform firmware.  This option supports the
+	suffixes "k" or "K" for KiB, "m" or "M" for MiB, "g" or "G" for
+	GiB and "t" or "T" for TiB.
 
 -e::
 --reconfig=::
Signature · 6 lines
2.7.4

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
#1 lore raw

PATCH 2/2 ndctl: fix return value for disable-namespace

On success the "ndctl disable-namespace" returns the number of namespaces that were disabled to the shell as an exit value. This non-zero value is interpreted by the shell as an error.

Fix this by returning 0 on success, just like all the other ndctl commands.

---
 ndctl/builtin-xaction-namespace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ndctl/builtin-xaction-namespace.c +1 -1
index 9b1702d..c556252 100644
@@ -790,7 +790,7 @@ int cmd_disable_namespace(int argc, const char **argv, struct ndctl_ctx *ctx)
 	} else {
 		fprintf(stderr, "disabled %d namespace%s\n", disabled,
 				disabled > 1 ? "s" : "");
-		return disabled;
+		return 0;
 	}
 }
 
Signature · 6 lines
2.7.4

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
#2 lore raw

Re: [PATCH 2/2] ndctl: fix return value for disable-namespace

Quoted 25 lines · Ross Zwisler

On success the "ndctl disable-namespace" returns the number of namespaces that were disabled to the shell as an exit value. This non-zero value is interpreted by the shell as an error.

Fix this by returning 0 on success, just like all the other ndctl commands.

---
 ndctl/builtin-xaction-namespace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ndctl/builtin-xaction-namespace.c +1 -2
index 9b1702d..c556252 100644
@@ -790,7 +790,7 @@ int cmd_disable_namespace(int argc, const char **argv, struct ndctl_ctx *ctx)
        } else {
                fprintf(stderr, "disabled %d namespace%s\n", disabled,
                                disabled > 1 ? "s" : "");
-               return disabled;
+               return 0;
        }
 }
 
--
Quoted 2 lines

2.7.4

Thanks Ross. Applied.
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm

#3 lore raw
In reply to Ross Zwisler
Quoted 16 lines · Ross Zwisler

Add information about the supported size suffixes to the documentation for ndctl-create-namespace. This prevents users from doing silly things like $((32*1024*1024*1024)) on the command line when running ndctl commands.

---
 Documentation/ndctl-create-namespace.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Documentation/ndctl-create-namespace.txt +0 -0
index a2f5e5b..5b62b95 100644
@@ -79,8 +79,10 @@ OPTIONS
 -s::
 --size=::

Documentation/ndctl-create-namespace.txt OPTIONS · line 88

Quoted 10 lines
Documentation/ndctl-create-namespace.txt +4 -2
        For NVDIMM devices that support namespace labels, set the
-       namespace size.  Otherwise it defaults to the maximum size
-       specified by platform firmware.
+       namespace size in bytes.  Otherwise it defaults to the maximum
+       size specified by platform firmware.  This option supports the
+       suffixes "k" or "K" for KiB, "m" or "M" for MiB, "g" or "G" for
+       GiB and "t" or "T" for TiB.
 
 -e::
 --reconfig=::

Thanks Ross. Applied.
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm