Skip to content

Commit 1b5453b

Browse files
author
Darrick J. Wong
committed
xfs: support recovering bmap intent items targetting realtime extents
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> Reviewed-by: Christoph Hellwig <hch@lst.de>
1 parent 7302cda commit 1b5453b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

fs/xfs/xfs_bmap_item.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,9 @@ xfs_bui_validate(
435435
if (!xfs_verify_fileext(mp, map->me_startoff, map->me_len))
436436
return false;
437437

438+
if (map->me_flags & XFS_BMAP_EXTENT_REALTIME)
439+
return xfs_verify_rtbext(mp, map->me_startblock, map->me_len);
440+
438441
return xfs_verify_fsbext(mp, map->me_startblock, map->me_len);
439442
}
440443

@@ -510,6 +513,12 @@ xfs_bmap_recover_work(
510513
xfs_ilock(ip, XFS_ILOCK_EXCL);
511514
xfs_trans_ijoin(tp, ip, 0);
512515

516+
if (!!(map->me_flags & XFS_BMAP_EXTENT_REALTIME) !=
517+
xfs_ifork_is_realtime(ip, work->bi_whichfork)) {
518+
error = -EFSCORRUPTED;
519+
goto err_cancel;
520+
}
521+
513522
if (work->bi_type == XFS_BMAP_MAP)
514523
iext_delta = XFS_IEXT_ADD_NOSPLIT_CNT;
515524
else

0 commit comments

Comments
 (0)