Device-DAX explicitly disallows MAP_PRIVATE mappings.
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
---
test/device-dax.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/test/device-dax.c b/test/device-dax.c
index 34ca284f2ef5..a14e2a95db7e 100644
--- a/test/device-dax.c
+++ b/test/device-dax.c
@@ -113,6 +113,12 @@ static int test_device_dax(int loglevel, struct ndctl_test *test,
return -ENXIO;
}
+ buf = mmap(NULL, 2UL << 20, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0);
+ if (buf != MAP_FAILED) {
+ fprintf(stderr, "%s: expected MAP_PRIVATE failure\n", path);
+ return -ENXIO;
+ }
+
buf = mmap(NULL, 2UL << 20, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
p = (int *) (buf + (1UL << 20));
*p = 0;
Show replies by date