Skip to content

Commit 69ffe59

Browse files
osandovdjwong
authored andcommitted
xfs: don't check for AG deadlock for realtime files in bunmapi
Commit 5b094d6 ("xfs: fix multi-AG deadlock in xfs_bunmapi") added a check in __xfs_bunmapi() to stop early if we would touch multiple AGs in the wrong order. However, this check isn't applicable for realtime files. In most cases, it just makes us do unnecessary commits. However, without the fix from the previous commit ("xfs: fix realtime file data space leak"), if the last and second-to-last extents also happen to have different "AG numbers", then the break actually causes __xfs_bunmapi() to return without making any progress, which sends xfs_itruncate_extents_flags() into an infinite loop. Fixes: 5b094d6 ("xfs: fix multi-AG deadlock in xfs_bunmapi") Signed-off-by: Omar Sandoval <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Darrick J. Wong <[email protected]>
1 parent 0c4da70 commit 69ffe59

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/xfs/libxfs/xfs_bmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5404,7 +5404,7 @@ __xfs_bunmapi(
54045404
* Make sure we don't touch multiple AGF headers out of order
54055405
* in a single transaction, as that could cause AB-BA deadlocks.
54065406
*/
5407-
if (!wasdel) {
5407+
if (!wasdel && !isrt) {
54085408
agno = XFS_FSB_TO_AGNO(mp, del.br_startblock);
54095409
if (prev_agno != NULLAGNUMBER && prev_agno > agno)
54105410
break;

0 commit comments

Comments
 (0)