summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2022-07-14 11:06:38 -0700
committerDarrick J. Wong <djwong@kernel.org>2022-10-14 14:16:48 -0700
commit2f2fc0efb0d1a09f060304cd005d78c0118faa21 (patch)
treebb7a19d1761e66fda1bc9b450fe13c20443f311d
parent2b77cd75da73c2a18d786250ad5fe311c3c812d2 (diff)
xfs: support recovering bmap intent items targetting realtime extentsrealtime-bmap-intents_2022-10-14
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 227bd72b071a..98dc12ac1d7d 100644
--- a/fs/xfs/xfs_bmap_item.c
+++ b/fs/xfs/xfs_bmap_item.c
@@ -485,6 +485,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);
}
@@ -532,6 +535,12 @@ xfs_bui_item_recover(
xfs_ilock(ip, XFS_ILOCK_EXCL);
xfs_trans_ijoin(tp, ip, 0);
+ if (!!(map->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