diff mbox

[ndctl,2/4] ndctl, create-namespace: catch attempts to set device-dax for blk namespaces

Message ID 151079865407.25456.13016376113663731019.stgit@dwillia2-desk3.amr.corp.intel.com (mailing list archive)
State Accepted
Commit 3fe3636e74ba
Headers show

Commit Message

Dan Williams Nov. 16, 2017, 2:17 a.m. UTC
Similar to the filesytem-dax case blk type namespaces do not support
device-dax operation.

Fixes: 3139dfda1158 ("ndctl: create namespace")
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 ndctl/namespace.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/ndctl/namespace.c b/ndctl/namespace.c
index 0020be354670..970515570ce9 100644
--- a/ndctl/namespace.c
+++ b/ndctl/namespace.c
@@ -208,8 +208,9 @@  static int set_defaults(enum device_action mode)
 
 	/* check for incompatible mode and type combinations */
 	if (param.type && param.mode && strcmp(param.type, "blk") == 0
-			&& strcmp(param.mode, "memory") == 0) {
-		error("only 'pmem' namespaces can be placed into 'memory' mode\n");
+			&& (strcmp(param.mode, "memory") == 0
+				|| strcmp(param.mode, "dax") == 0)) {
+		error("only 'pmem' namespaces support dax operation\n");
 		rc = -ENXIO;
 	}