diff options
author | Shiyang Ruan <[email protected]> | 2022-06-09 22:34:35 +0800 |
---|---|---|
committer | akpm <[email protected]> | 2022-07-29 18:07:17 -0700 |
commit | 35fcd75af3edf035638e632bb49607cc8fc3cdf4 (patch) | |
tree | 0fd3a9947f6ac494957885eaa4fd63f1cc898061 | |
parent | 873f64b791a2b43c246e78b7d9fdd64ce909685b (diff) |
xfs: fail dax mount if reflink is enabled on a partition
Failure notification is not supported on partitions. So, when we mount a
reflink enabled xfs on a partition with dax option, let it fail with
-EINVAL code.
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Shiyang Ruan <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Reviewed-by: Darrick J. Wong <[email protected]>
Cc: Dave Chinner <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
-rw-r--r-- | fs/xfs/xfs_super.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index ed18160e6181..c440e90fecef 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -350,8 +350,10 @@ xfs_setup_dax_always( goto disable_dax; } - if (xfs_has_reflink(mp)) { - xfs_alert(mp, "DAX and reflink cannot be used together!"); + if (xfs_has_reflink(mp) && + bdev_is_partition(mp->m_ddev_targp->bt_bdev)) { + xfs_alert(mp, + "DAX and reflink cannot work with multi-partitions!"); return -EINVAL; } |