Message ID | CAPcyv4iAGx8BSaZvjXhe-eoPah4EtQzbckgZfHW_a3us6QCH6w@mail.gmail.com (mailing list archive) |
---|---|
State | Rejected |
Headers | show |
diff --git a/ndctl/builtin-xaction-namespace.c b/ndctl/builtin-xaction-namespace.c index e136bfdefa39..35345fb26ec3 100644 --- a/ndctl/builtin-xaction-namespace.c +++ b/ndctl/builtin-xaction-namespace.c @@ -210,8 +210,13 @@ static int set_defaults(enum namespace_action mode) error("'pmem' namespaces do not support setting 'sector size'\n"); rc = -EINVAL; } - } else if (!param.reconfig) - param.sector_size = "4096"; + } else if (!param.reconfig + && (param.type && strcmp(param.type, "blk") == 0 + || (param.mode + && strcmp(param.mode, "safe") == 0))) { + /* default sector size for blk-type or safe-mode */ + param.sector_size = "4096"; + } return rc;