OSDN Git Service

xfs: don't allow DAX on reflink filesystems
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 31 Jan 2018 22:21:56 +0000 (14:21 -0800)
committerDarrick J. Wong <darrick.wong@oracle.com>
Fri, 2 Feb 2018 05:06:15 +0000 (21:06 -0800)
Now that reflink is no longer experimental, reject attempts to mount
with DAX until that whole mess gets sorted out.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Bill O'Donnell <billodo@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
fs/xfs/xfs_super.c

index f3e0001..0505605 100644 (file)
@@ -1666,9 +1666,12 @@ xfs_fs_fill_super(
                        "DAX unsupported by block device. Turning off DAX.");
                        mp->m_flags &= ~XFS_MOUNT_DAX;
                }
-               if (xfs_sb_version_hasreflink(&mp->m_sb))
+               if (xfs_sb_version_hasreflink(&mp->m_sb)) {
                        xfs_alert(mp,
                "DAX and reflink cannot be used together!");
+                       error = -EINVAL;
+                       goto out_filestream_unmount;
+               }
        }
 
        if (mp->m_flags & XFS_MOUNT_DISCARD) {