]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
mkfs.xfs: Assign proper defaults to rmapbt and reflink flags
authorEric Sandeen <sandeen@redhat.com>
Tue, 2 May 2017 16:12:53 +0000 (11:12 -0500)
committerEric Sandeen <sandeen@redhat.com>
Tue, 2 May 2017 16:12:53 +0000 (11:12 -0500)
The "defaultval" field in the options structure was a bit confusing,
so when the rmapbt & reflink options got added, the desire was
to keep them off by default, and "defaultval = 0" got set.

However, the purpose of this field is to define the default value
when the flag is specified with no associated value, i.e.

-m rmapbt vs. -m rmapbt=0 or -m rmapbt=1

Today, the resulting behavior is unexpected, and different from any
other mkfs flags; specifying "-m rmapbt,reflink" results in a
filesystem /without/ those features.

Fix these to be consistent with every other boolean flag in the
mkfs options, so that specifying the flag with no value will
enable the feature.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
mkfs/xfs_mkfs.c

index 6fedc05c2fa60a0ebf5e1f371b2263b621ed1414..930f3d2aad6f9c47eaf630153b8ba0bbd22cc530 100644 (file)
@@ -697,13 +697,13 @@ struct opt_params mopts = {
                  .conflicts = { LAST_CONFLICT },
                  .minval = 0,
                  .maxval = 1,
-                 .defaultval = 0,
+                 .defaultval = 1,
                },
                { .index = M_REFLINK,
                  .conflicts = { LAST_CONFLICT },
                  .minval = 0,
                  .maxval = 1,
-                 .defaultval = 0,
+                 .defaultval = 1,
                },
        },
 };