archive mirror
 help / color / mirror / Atom feed
* [ndctl patch] zero_info_block: skip seed devices
@ 2021-02-09 21:51 Jeff Moyer
  0 siblings, 0 replies; only message in thread
From: Jeff Moyer @ 2021-02-09 21:51 UTC (permalink / raw)
  To: Vishal Verma; +Cc: linux-nvdimm

Currently, ndctl destroy-namespace -f all will output errors of the

  Error: destroy namespace: namespace0.0 failed to enable for zeroing, continuing

for any zero-sized namespace.  That particular namespace looks like this:


This patch skips over namespaces with size=0 when zeroing out info

Fixes: 46654c2d60b70 ("ndctl/namespace: Always zero info-blocks")
Reported-by: Zhang Yi <>
Signed-off-by: Jeff Moyer <>

diff --git a/ndctl/namespace.c b/ndctl/namespace.c
index 0c8df9f..de1e08f 100644
--- a/ndctl/namespace.c
+++ b/ndctl/namespace.c
@@ -1052,6 +1052,9 @@ static int zero_info_block(struct ndctl_namespace *ndns)
 	void *buf = NULL, *read_buf = NULL;
 	char path[50];
+	if (ndctl_namespace_get_size(ndns) == 0)
+		return 1;
 	ndctl_namespace_set_raw_mode(ndns, 1);
 	rc = ndctl_namespace_enable(ndns);
 	if (rc < 0) {
Linux-nvdimm mailing list --
To unsubscribe send an email to

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-09 21:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-09 21:51 [ndctl patch] zero_info_block: skip seed devices Jeff Moyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).