diff mbox

[ndctl,6/9] ndctl, create-namespace: fix blk-namepsaces vs device-dax

Message ID 146698349971.40541.523525969582933339.stgit@dwillia2-desk3.amr.corp.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Williams June 26, 2016, 11:24 p.m. UTC
Emit a usable error message when on attempts to place a blk-namespace
into device-dax mode.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 ndctl/builtin-xaction-namespace.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/ndctl/builtin-xaction-namespace.c b/ndctl/builtin-xaction-namespace.c
index 8ce7c3e55216..7bf3320473ff 100644
--- a/ndctl/builtin-xaction-namespace.c
+++ b/ndctl/builtin-xaction-namespace.c
@@ -403,9 +403,12 @@  static int validate_namespace_options(struct ndctl_region *region,
 
 		if (ndns && ndctl_namespace_get_type(ndns)
 				== ND_DEVICE_NAMESPACE_BLK
-				&& p->mode == NDCTL_NS_MODE_MEMORY) {
-			debug("%s: blk namespace do not support memory mode\n",
-					ndctl_namespace_get_devname(ndns));
+				&& (p->mode == NDCTL_NS_MODE_MEMORY
+					|| p->mode == NDCTL_NS_MODE_DAX)) {
+			debug("%s: blk namespace do not support %s mode\n",
+					ndctl_namespace_get_devname(ndns),
+					p->mode == NDCTL_NS_MODE_MEMORY
+					? "memory" : "dax");
 				return -EINVAL;
 		}
 	} else if (ndns)