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(a)infradead.org>
Reported-by: Cheng-mean Liu <soccerl(a)microsoft.com>
Signed-off-by: Dan Williams <dan.j.williams(a)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);
Show replies by thread