Linux-NVDIMM Archive on
 help / color / Atom feed
From: Santosh Sivaraj <>
	Vishal Verma <>,
Cc: Dan Williams <>
Subject: [PATCH ndctl] namespace/create: Don't create multiple namespace unless greedy
Date: Wed,  4 Dec 2019 15:25:53 +0530
Message-ID: <> (raw)

From: Vaibhav Jain <>

Currently create-namespace creates two namespaces with the '-f' option
even without the greedy flag. This behavior got introduced by
c75f7236d. The earlier behaviour was to create one namespace even with
the '-f' flag. The earlier behavior:

$ sudo ./ndctl/ndctl create-namespace -s 16M -f
[sudo] password for santosh:
  "size":"14.00 MiB (14.68 MB)",

After greedy option was introduced:

$ sudo ./ndctl/ndctl create-namespace -s 16M -f
  "size":"14.00 MiB (14.68 MB)",
  "size":"14.00 MiB (14.68 MB)",

If no region or '-c' flag is specified bail out if the creation was successful.

Fixes: c75f7236d (ndctl/namespace: add a --continue option to create namespaces greedily)
Signed-off-by: Santosh Sivaraj <>
Signed-off-by: Vaibhav Jain <>
 ndctl/namespace.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ndctl/namespace.c b/ndctl/namespace.c
index 7fb0007..8098456 100644
--- a/ndctl/namespace.c
+++ b/ndctl/namespace.c
@@ -1392,6 +1392,8 @@ static int do_xaction_namespace(const char *namespace,
 				if (force) {
 					if (rc)
 						saved_rc = rc;
+					else if (!param.region)
+							return rc;
 				return rc;
Linux-nvdimm mailing list --
To unsubscribe send an email to

             reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-04  9:55 Santosh Sivaraj [this message]
2019-12-04 17:51 ` Dan Williams

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-NVDIMM Archive on

Archives are clonable:
	git clone --mirror linux-nvdimm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nvdimm linux-nvdimm/ \
	public-inbox-index linux-nvdimm

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone