summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2021-09-01 11:19:48 -0700
committerDarrick J. Wong <djwong@kernel.org>2021-10-22 16:41:11 -0700
commit4d3008fea0bfb20477d227f021046ac809c723ca (patch)
tree7c4032505053ff881c62a4ab0d0f10d58f3ec1c0
parent48c1983a9dd0990e05f4329d9b9f0ccf79c72cdf (diff)
xfs: enable realtime reflinkrealtime-reflink_2021-10-22
Enable reflink for realtime devices, sort of. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
-rw-r--r--fs/xfs/xfs_super.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index e87769a99ec9..108d0d6865a6 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -1689,14 +1689,27 @@ xfs_fs_fill_super(
"EXPERIMENTAL metadata directory 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;
}