]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
mkfs: require reflink for max_atomic_write option
authorJohn Garry <john.g.garry@oracle.com>
Wed, 30 Jul 2025 10:13:20 +0000 (10:13 +0000)
committerAndrey Albershteyn <aalbersh@kernel.org>
Fri, 8 Aug 2025 11:39:31 +0000 (13:39 +0200)
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 <john.g.garry@oracle.com>
Suggested-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
mkfs/xfs_mkfs.c

index b889c0de9c0d464c7c0610a5993598a8d283dab0..8cd4ccd70dcc7642ae27c8b61c3e63c00cdd7c78 100644 (file)
@@ -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.
         */