From 594932fbf720da416d69d81e6f6d3c29435f122d Mon Sep 17 00:00:00 2001 From: Dave Chinner Date: Wed, 6 Dec 2017 17:14:27 -0600 Subject: [PATCH] mkfs: disallow specifying the sector size of internal log If the log is on the data device (i.e. internal) then it should match the sector size the data device is using. If they don't match, then one or the other doesn't have atomic sector writes and we could have crash consistency problems. Not to mention that it's simply wrong to have two different sector sizes for the same device. Hence enforce the requirement that an internal log device always has the same sector size as the data device. Signed-Off-By: Dave Chinner Reviewed-by: Eric Sandeen Signed-off-by: Eric Sandeen --- mkfs/xfs_mkfs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index cade04cc3..b3d8a5110 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -436,6 +436,8 @@ struct opt_params lopts = { { .index = L_INTERNAL, .conflicts = { L_FILE, L_DEV, + L_SECTLOG, + L_SECTSIZE, LAST_CONFLICT }, .minval = 0, .maxval = 1, @@ -477,6 +479,7 @@ struct opt_params lopts = { }, { .index = L_SECTLOG, .conflicts = { L_SECTSIZE, + L_INTERNAL, LAST_CONFLICT }, .minval = XFS_MIN_SECTORSIZE_LOG, .maxval = XFS_MAX_SECTORSIZE_LOG, @@ -484,6 +487,7 @@ struct opt_params lopts = { }, { .index = L_SECTSIZE, .conflicts = { L_SECTLOG, + L_INTERNAL, LAST_CONFLICT }, .convert = true, .is_power_2 = true, -- 2.47.2