]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
xfs: fix xfs_bmap_validate_extent_raw when checking attr fork of rt files
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 2 Sep 2020 17:47:02 +0000 (10:47 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Sep 2020 17:12:28 +0000 (19:12 +0200)
[ Upstream commit d0c20d38af135b2b4b90aa59df7878ef0c8fbef4 ]

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>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/xfs/libxfs/xfs_bmap.c

index 3f76da11197c4c16ad76e1f05cbf680e8b53fe43..19a600443b9ee8c31e3a997b4c3c578ba9a64e3c 100644 (file)
@@ -6179,7 +6179,7 @@ xfs_bmap_validate_extent(
 
        isrt = XFS_IS_REALTIME_INODE(ip);
        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))