anitazha / rpms / ndctl

Forked from rpms/ndctl a year ago
Clone

Blame SOURCES/ndctl-skip-seed-devices-in-zero_info_block.patch

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