Skip to content

Commit

Permalink
xfs: fail dax mount if reflink is enabled on a partition
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
irides authored and akpm00 committed Jul 30, 2022
1 parent 873f64b commit 35fcd75
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fs/xfs/xfs_super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 35fcd75

Please sign in to comment.