Skip to content

Commit 35fcd75

Browse files
iridesakpm00
authored andcommitted
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/20220609143435.393724-1-ruansy.fnst@fujitsu.com Signed-off-by: Shiyang Ruan <ruansy.fnst@fujitsu.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Cc: Dave Chinner <david@fromorbit.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 873f64b commit 35fcd75

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

fs/xfs/xfs_super.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,10 @@ xfs_setup_dax_always(
350350
goto disable_dax;
351351
}
352352

353-
if (xfs_has_reflink(mp)) {
354-
xfs_alert(mp, "DAX and reflink cannot be used together!");
353+
if (xfs_has_reflink(mp) &&
354+
bdev_is_partition(mp->m_ddev_targp->bt_bdev)) {
355+
xfs_alert(mp,
356+
"DAX and reflink cannot work with multi-partitions!");
355357
return -EINVAL;
356358
}
357359

0 commit comments

Comments
 (0)