diff mbox series

xfs: fix xfs_bmap_validate_extent_raw when checking attr fork of rt files

Message ID 20200902164012.GN6096@magnolia (mailing list archive)
State Superseded
Headers show
Series xfs: fix xfs_bmap_validate_extent_raw when checking attr fork of rt files | expand

Commit Message

Darrick J. Wong Sept. 2, 2020, 4:40 p.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

The realtime flag only applies to the data fork, so don't use the
realtime block number checks on the attr fork of a realtime file.

Fixes: 30b0984d9117 ("xfs: refactor bmap record validation")
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/libxfs/xfs_bmap.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Darrick J. Wong Sept. 2, 2020, 5:38 p.m. UTC | #1
On Wed, Sep 02, 2020 at 09:40:12AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> The realtime flag only applies to the data fork, so don't use the
> realtime block number checks on the attr fork of a realtime file.
> 
> Fixes: 30b0984d9117 ("xfs: refactor bmap record validation")
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

NAK, I should've sent this from my stable tree, not my dev tree.

--D

> ---
>  fs/xfs/libxfs/xfs_bmap.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
> index ce2e702b6b43..d35250c9bb07 100644
> --- a/fs/xfs/libxfs/xfs_bmap.c
> +++ b/fs/xfs/libxfs/xfs_bmap.c
> @@ -6310,7 +6310,7 @@ xfs_bmap_validate_extent_raw(
>  	xfs_fsblock_t		endfsb;
>  
>  	endfsb = irec->br_startblock + irec->br_blockcount - 1;
> -	if (isrt) {
> +	if (isrt && whichfork == XFS_DATA_FORK) {
>  		if (!xfs_verify_rtbno(mp, irec->br_startblock))
>  			return __this_address;
>  		if (!xfs_verify_rtbno(mp, endfsb))
diff mbox series

Patch

diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index ce2e702b6b43..d35250c9bb07 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -6310,7 +6310,7 @@  xfs_bmap_validate_extent_raw(
 	xfs_fsblock_t		endfsb;
 
 	endfsb = irec->br_startblock + irec->br_blockcount - 1;
-	if (isrt) {
+	if (isrt && whichfork == XFS_DATA_FORK) {
 		if (!xfs_verify_rtbno(mp, irec->br_startblock))
 			return __this_address;
 		if (!xfs_verify_rtbno(mp, endfsb))