From: John Garry Date: Wed, 30 Jul 2025 10:13:20 +0000 (+0000) Subject: mkfs: require reflink for max_atomic_write option X-Git-Tag: v6.16.0~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=264762bb42b9d32793161c0d64c5a34e1f741fd3;p=thirdparty%2Fxfsprogs-dev.git mkfs: require reflink for max_atomic_write option For max_atomic_write option to be set, it means that the user wants to support atomic writes up to that size. However, to support this we must have reflink, so enforce that this is available. Signed-off-by: John Garry Suggested-by: "Darrick J. Wong" Reviewed-by: "Darrick J. Wong" --- diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index b889c0de..8cd4ccd7 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -3101,6 +3101,12 @@ _("metadir not supported without exchange-range support\n")); cli->sb_feat.exchrange = true; } + if (cli_opt_set(&iopts, I_MAX_ATOMIC_WRITE) && !cli->sb_feat.reflink) { + fprintf(stderr, +_("max_atomic_write option not supported without reflink support\n")); + usage(); + } + /* * Copy features across to config structure now. */