From: Eric Sandeen Date: Tue, 2 May 2017 16:12:53 +0000 (-0500) Subject: mkfs.xfs: Assign proper defaults to rmapbt and reflink flags X-Git-Tag: v4.11.0-rc2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=23069a9353eb8af30f3427feed6c92380d025a53;p=thirdparty%2Fxfsprogs-dev.git mkfs.xfs: Assign proper defaults to rmapbt and reflink flags 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 Reviewed-by: Darrick J. Wong Signed-off-by: Eric Sandeen --- diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index 6fedc05c2..930f3d2aa 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -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, }, }, };