]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
mkfs: disallow specifying the sector size of internal log
authorDave Chinner <dchinner@redhat.com>
Wed, 6 Dec 2017 23:14:27 +0000 (17:14 -0600)
committerEric Sandeen <sandeen@redhat.com>
Wed, 6 Dec 2017 23:14:27 +0000 (17:14 -0600)
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 <dchinner@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
mkfs/xfs_mkfs.c

index cade04cc396818b852de64c729f2172c0cb0128e..b3d8a51107f9d741f73a6338b91e80ad1a425f71 100644 (file)
@@ -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,