diff options
author | Darrick J. Wong <djwong@kernel.org> | 2022-07-14 11:16:14 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2022-10-14 14:17:26 -0700 |
commit | 9c45a323ba3960f5eeef693a05e3437a1500beef (patch) | |
tree | 6cdc7a96f8d2653a12dd19e2e58bc374c92c5e92 | |
parent | f351fb1c1006b3e055b2c70268004bed6799fd70 (diff) |
xfs: enable realtime reflinkrealtime-reflink_2022-10-14
Enable reflink for realtime devices, sort of.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
-rw-r--r-- | fs/xfs/xfs_super.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 8ecd5971c911..c3a1e195df67 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -1650,14 +1650,27 @@ xfs_fs_fill_super( "EXPERIMENTAL realtime allocation group feature in use. Use at your own risk!"); if (xfs_has_reflink(mp)) { - if (mp->m_sb.sb_rblocks) { + /* + * Reflink doesn't support rt extent sizes larger than a single + * block because we would have to perform unshare-around for + * rtext-unaligned write requests. + */ + if (xfs_has_realtime(mp) && mp->m_sb.sb_rextsize != 1) { xfs_alert(mp, - "reflink not compatible with realtime device!"); + "reflink not compatible with realtime extent size %u!", + mp->m_sb.sb_rextsize); error = -EINVAL; goto out_filestream_unmount; } - if (xfs_globals.always_cow) { + /* + * always-cow mode is not supported on filesystems with rt + * extent sizes larger than a single block because we'd have + * to perform write-around for unaligned writes because remap + * requests must be aligned to an rt extent. + */ + if (xfs_globals.always_cow && + (!xfs_has_realtime(mp) || mp->m_sb.sb_rextsize == 1)) { xfs_info(mp, "using DEBUG-only always_cow mode."); mp->m_always_cow = true; } |