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-03-25 17:08:26 -0700
commit8e114dc0720ea3b45aef86d6551a2404b58b4da2 (patch)
treeeb28b857a069b0887ec51fcae150fb87949dedaa
parent40aedba26aa8dfe02b941c27a955e3ac2c5245e0 (diff)
xfs: support recovering bmap intent items targetting realtime extentsrealtime-bmap-intents_2021-03-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 d7165de24f4b..20e064204956 100644
--- a/fs/xfs/xfs_bmap_item.c
+++ b/fs/xfs/xfs_bmap_item.c
@@ -452,6 +452,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);
}
@@ -513,6 +516,12 @@ xfs_bui_item_recover(
xfs_ilock(ip, XFS_ILOCK_EXCL);
xfs_trans_ijoin(tp, ip, 0);
+ if (!!(bmap->me_flags & XFS_BMAP_EXTENT_REALTIME) !=
+ xfs_ifork_is_realtime(ip, whichfork)) {
+ error = -EFSCORRUPTED;
+ goto err_cancel;
+ }
+
if (bui_type == XFS_BMAP_MAP)
iext_delta = XFS_IEXT_ADD_NOSPLIT_CNT;
else