summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2021-01-05 17:45:05 -0800
committerDarrick J. Wong <djwong@kernel.org>2021-08-25 22:25:58 -0700
commit0745b334d24a9f8dc9699917daf0076a104e190b (patch)
tree59ed716bb3fe51341e5edc86c49d212359996499
parent3c4a86b181f06cf44b2db1969c68dfd723b7f13d (diff)
xfs: support recovering bmap intent items targetting realtime extentsrealtime-bmap-intents_2021-08-25
Now that we have reflink on the realtime device, bmap intent items have to support remapping extents on the realtime volume. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
-rw-r--r--fs/xfs/xfs_bmap_item.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/xfs/xfs_bmap_item.c b/fs/xfs/xfs_bmap_item.c
index cb7520784eb7..d845e6f5f1f6 100644
--- a/fs/xfs/xfs_bmap_item.c
+++ b/fs/xfs/xfs_bmap_item.c
@@ -423,6 +423,9 @@ xfs_bui_validate(
if (!xfs_verify_fileext(mp, bmap->me_startoff, bmap->me_len))
return false;
+ if (bmap->me_flags & XFS_BMAP_EXTENT_REALTIME)
+ return xfs_verify_rtext(mp, bmap->me_startblock, bmap->me_len);
+
return xfs_verify_fsbext(mp, bmap->me_startblock, bmap->me_len);
}
@@ -478,6 +481,12 @@ xfs_bui_item_recover(
xfs_ilock(ip, XFS_ILOCK_EXCL);
xfs_trans_ijoin(tp, ip, 0);
+ if (!!(me->me_flags & XFS_BMAP_EXTENT_REALTIME) !=
+ xfs_ifork_is_realtime(ip, fake.bi_whichfork)) {
+ error = -EFSCORRUPTED;
+ goto err_cancel;
+ }
+
if (fake.bi_type == XFS_BMAP_MAP)
iext_delta = XFS_IEXT_ADD_NOSPLIT_CNT;
else