]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
mkfs: enable reflink by default
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 6 Jun 2019 13:58:55 +0000 (08:58 -0500)
committerEric Sandeen <sandeen@redhat.com>
Thu, 6 Jun 2019 13:58:55 +0000 (08:58 -0500)
Data block sharing (a.k.a. reflink) has been stable for a while, so turn
it on by default.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
[sandeen: update comments & man page]
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>
man/man8/mkfs.xfs.8
mkfs/xfs_mkfs.c

index 4b8c78c3780625d686a5ba7f024eeddaded35eac..78b150155370e672a30dc6ad3aaf5655b9d871e6 100644 (file)
@@ -231,7 +231,7 @@ available for the data forks of regular files.
 .IP
 By default,
 .B mkfs.xfs
-will not create reference count btrees and therefore will not enable the
+will create reference count btrees and therefore will enable the
 reflink feature.  This feature is only available for filesystems created with
 the (default)
 .B \-m crc=1
@@ -239,6 +239,13 @@ option set. When the option
 .B \-m crc=0
 is used, the reference count btree feature is not supported and reflink is
 disabled.
+.IP
+Note: the filesystem DAX mount option (
+.B \-o dax
+) is incompatible with
+reflink-enabled XFS filesystems.  To use filesystem DAX with XFS, specify the
+.B \-m reflink=0
+option to mkfs.xfs to disable the reflink feature.
 .RE
 .TP
 .BI \-d " data_section_options"
index 091066485e37d80d918ce28983e7acba9b5bebee..ddb25ecc57462f86cf84f9ff13515ed638022be9 100644 (file)
@@ -1973,15 +1973,15 @@ _("Directory ftype field always enabled on CRC enabled filesystems\n"));
                        usage();
                }
 
-       } else {
+       } else {        /* !crcs_enabled */
                /*
-                * The kernel doesn't currently support crc=0,finobt=1
-                * filesystems. If crcs are not enabled and the user has not
-                * explicitly turned finobt on, then silently turn it off to
-                * avoid an unnecessary warning.
+                * The kernel doesn't support crc=0,finobt=1 filesystems.
+                * If crcs are not enabled and the user has not explicitly
+                * turned finobt on, then silently turn it off to avoid an
+                * unnecessary warning.
                 * If the user explicitly tried to use crc=0,finobt=1,
                 * then issue an error.
-                * The same is also for sparse inodes.
+                * The same is also true for sparse inodes and reflink.
                 */
                if (cli->sb_feat.finobt && cli_opt_set(&mopts, M_FINOBT)) {
                        fprintf(stderr,
@@ -2004,7 +2004,7 @@ _("rmapbt not supported without CRC support\n"));
                }
                cli->sb_feat.rmapbt = false;
 
-               if (cli->sb_feat.reflink) {
+               if (cli->sb_feat.reflink && cli_opt_set(&mopts, M_REFLINK)) {
                        fprintf(stderr,
 _("reflink not supported without CRC support\n"));
                        usage();
@@ -3876,7 +3876,7 @@ main(
                        .finobt = true,
                        .spinodes = true,
                        .rmapbt = false,
-                       .reflink = false,
+                       .reflink = true,
                        .parent_pointers = false,
                        .nodalign = false,
                        .nortalign = false,