Skip to contentSkip to conversation

xfs: fix xfs_bmap_validate_extent_raw when checking attr fork of rt files

PATCH In review Darrick J. Wong 2 participants 2 messages Sep 2, 2020 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 xfs: fix xfs_bmap_validate_extent_raw when checking attr fork of rt files

From: Darrick J. Wong <[email protected]>

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")

---
v2: send from stable tree, not dev tree

---
 fs/xfs/libxfs/xfs_bmap.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/libxfs/xfs_bmap.c +1 -1
index 9c40d5971035..1b0a01b06a05 100644
@@ -6226,7 +6226,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))
Reviewed-by on v2 1/1
#1 lore raw
Quoted 7 lines · Darrick J. Wong

From: Darrick J. Wong <[email protected]>

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")

Seems legit

Quoted 20 lines

---
v2: send from stable tree, not dev tree

---
 fs/xfs/libxfs/xfs_bmap.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/libxfs/xfs_bmap.c +1 -1
index 9c40d5971035..1b0a01b06a05 100644
@@ -6226,7 +6226,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))