nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [ndctl PATCH] ndctl: update minimum namespace size
@ 2018-02-02  8:29 Dan Williams
  0 siblings, 0 replies; only message in thread
From: Dan Williams @ 2018-02-02  8:29 UTC (permalink / raw)
  To: linux-nvdimm

The kernel starting with version v4.16 supports a minimum namespace size
as low as PAGE_SIZE. Update the dpa-alloc test to account for the fact
that its 4K allocations may result in the namespace being activated with
its parent region.

Cc: Matthew Wilcox <willy@infradead.org>
Reported-by: Cheng-mean Liu <soccerl@microsoft.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 ndctl/ndctl.h    |    3 ++-
 test/dpa-alloc.c |    5 +++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ndctl/ndctl.h b/ndctl/ndctl.h
index 4cf373b2a5d4..eb5a9b387b3d 100644
--- a/ndctl/ndctl.h
+++ b/ndctl/ndctl.h
@@ -15,6 +15,7 @@
 
 #include <ccan/array_size/array_size.h>
 #include <linux/types.h>
+#include <sys/user.h>
 
 struct nd_cmd_dimm_flags {
 	__u32 status;
@@ -210,7 +211,7 @@ enum nd_driver_flags {
 };
 
 enum {
-	ND_MIN_NAMESPACE_SIZE = 0x00400000,
+	ND_MIN_NAMESPACE_SIZE = PAGE_SIZE,
 };
 
 enum ars_masks {
diff --git a/test/dpa-alloc.c b/test/dpa-alloc.c
index 7793650699da..8bb7dd7408a1 100644
--- a/test/dpa-alloc.c
+++ b/test/dpa-alloc.c
@@ -232,6 +232,11 @@ static int do_test(struct ndctl_ctx *ctx, struct ndctl_test *test)
 
 		uuid_unparse(namespaces[i].uuid, uuid_str);
 		size = ndctl_namespace_get_size(victim);
+		rc = ndctl_namespace_disable(victim);
+		if (rc) {
+			fprintf(stderr, "failed to disable %s\n", uuid_str);
+			return rc;
+		}
 		rc = ndctl_namespace_delete(victim);
 		if (rc) {
 			fprintf(stderr, "failed to delete %s\n", uuid_str);

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

only message in thread, other threads:[~2018-02-02  8:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-02  8:29 [ndctl PATCH] ndctl: update minimum namespace size Dan Williams

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).