diff options
author | Darrick J. Wong <djwong@kernel.org> | 2021-09-01 10:46:54 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2021-12-15 17:28:58 -0800 |
commit | 0d1fe01c49998eb4d6b73af292cf29fc9fd24ab0 (patch) | |
tree | 47a28a4df845f1bca54024d81674471711ad3c9a | |
parent | af5c9f8dbdde967b4f19eb4b0539a67ec9b00637 (diff) |
xfs: support recovering bmap intent items targetting realtime extentsrealtime-bmap-intents_2021-12-15
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.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/xfs/xfs_bmap_item.c b/fs/xfs/xfs_bmap_item.c index 857e43fc7dd3..fd38fc59111f 100644 --- a/fs/xfs/xfs_bmap_item.c +++ b/fs/xfs/xfs_bmap_item.c @@ -422,6 +422,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); } @@ -469,6 +472,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 |