From 236e97a9bb71d104cf7c07126e7c505c04828bd6 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Sun, 25 Oct 2020 17:16:21 -0700 Subject: xfs: support recovering extent-free intent items targetting realtime extents Now that we have reflink on the realtime device, extent-free intent items have to support remapping extents on the realtime volume. Signed-off-by: Darrick J. Wong --- fs/xfs/xfs_extfree_item.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/fs/xfs/xfs_extfree_item.c b/fs/xfs/xfs_extfree_item.c index 1358faa65437..9e304e9fa162 100644 --- a/fs/xfs/xfs_extfree_item.c +++ b/fs/xfs/xfs_extfree_item.c @@ -619,14 +619,22 @@ xfs_efi_validate_ext( struct xfs_extent *extp) { xfs_fsblock_t end; + xfs_extlen_t len; - if (extp->ext_start + extp->ext_len <= extp->ext_start) + len = extp->ext_len & ~XFS_EFI_REALTIME_EXT; + if (extp->ext_start + len <= extp->ext_start) return false; - end = extp->ext_start + extp->ext_len - 1; - if (!xfs_verify_fsbno(mp, extp->ext_start) || - !xfs_verify_fsbno(mp, end)) - return false; + end = extp->ext_start + len - 1; + if (extp->ext_len & XFS_EFI_REALTIME_EXT) { + if (!xfs_verify_rtbno(mp, extp->ext_start) || + !xfs_verify_rtbno(mp, end)) + return false; + } else { + if (!xfs_verify_fsbno(mp, extp->ext_start) || + !xfs_verify_fsbno(mp, end)) + return false; + } return true; } -- cgit v1.2.3