From: Darrick J. Wong Date: Fri, 7 May 2021 14:42:17 +0000 (-0400) Subject: mkfs: reject cowextsize after making final decision about reflink support X-Git-Tag: v5.12.0-rc1~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=28927ccb94f6871b2e3688f240827e73cc25e109;p=thirdparty%2Fxfsprogs-dev.git mkfs: reject cowextsize after making final decision about reflink support There's a snippet of code that rejects cowextsize option if reflink is disabled. This really ought to be /after/ the last place where we can turn off reflink. Fix it so that people don't see stuff like this: $ mkfs.xfs -r rtdev=b.img a.img -f -d cowextsize=16 illegal CoW extent size hint 16, must be less than 9600. (reflink isn't supported when realtime is enabled) Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster Reviewed-by: Christoph Hellwig Signed-off-by: Eric Sandeen --- diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index 0eac53369..f84a42f98 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -2164,13 +2164,6 @@ _("inode btree counters not supported without finobt support\n")); cli->sb_feat.inobtcnt = false; } - if ((cli->fsx.fsx_xflags & FS_XFLAG_COWEXTSIZE) && - !cli->sb_feat.reflink) { - fprintf(stderr, -_("cowextsize not supported without reflink support\n")); - usage(); - } - if (cli->xi->rtname) { if (cli->sb_feat.reflink && cli_opt_set(&mopts, M_REFLINK)) { fprintf(stderr, @@ -2187,6 +2180,13 @@ _("rmapbt not supported with realtime devices\n")); cli->sb_feat.rmapbt = false; } + if ((cli->fsx.fsx_xflags & FS_XFLAG_COWEXTSIZE) && + !cli->sb_feat.reflink) { + fprintf(stderr, +_("cowextsize not supported without reflink support\n")); + usage(); + } + /* * Copy features across to config structure now. */