diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2020-10-25 17:16:21 -0700 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2020-10-26 18:32:37 -0700 |
commit | 236e97a9bb71d104cf7c07126e7c505c04828bd6 (patch) | |
tree | 147e17cc40fb7b5fdcad48c120e8de0ddbc6ce4e | |
parent | 6ae04990a3ef94ae672708e9bc0eaac99c064dcd (diff) |
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 <darrick.wong@oracle.com>
-rw-r--r-- | fs/xfs/xfs_extfree_item.c | 18 |
1 files 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; } |