All of lore.kernel.org
 help / color / mirror / Atom feed
* [ndctl PATCH] ndctl: fix the default BTT sector size for reconfig
@ 2018-01-29 20:22 Vishal Verma
  2018-01-29 20:46 ` Dan Williams
  2018-01-29 21:25 ` Ross Zwisler
  0 siblings, 2 replies; 3+ messages in thread
From: Vishal Verma @ 2018-01-29 20:22 UTC (permalink / raw)
  To: linux-nvdimm

reconfig attempted to reuse the 'previous' value for sector-size when
reconfiguring to a BTT mode or blk type namespace, but this may not
always be valid (for example when coming from a memory mode namespace).
Instead, when reconfiguring to BTT or blk, always default to 4096
unless a sector size is explicitly provided.

Cc: Dan Williams <dan.j.williams@intel.com>
Reported-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Tested-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---
 ndctl/namespace.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/ndctl/namespace.c b/ndctl/namespace.c
index c793ba3..ceb9e7a 100644
--- a/ndctl/namespace.c
+++ b/ndctl/namespace.c
@@ -244,12 +244,10 @@ static int set_defaults(enum device_action mode)
 			error("invalid sector size: %s\n", param.sector_size);
 			rc = -EINVAL;
 		}
-	} 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";
+	} else if (((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;
-- 
2.14.3

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-29 21:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-29 20:22 [ndctl PATCH] ndctl: fix the default BTT sector size for reconfig Vishal Verma
2018-01-29 20:46 ` Dan Williams
2018-01-29 21:25 ` Ross Zwisler

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.