Skip to content

Commit b44bfc0

Browse files
author
Darrick J. Wong
committed
xfs: fix iunlock calls in xrep_adoption_trans_alloc
If the transaction allocation in xrep_adoption_trans_alloc fails, we should drop only the locks that we took. In this case this is ILOCK_EXCL of both the orphanage and the file being repaired. Dropping any IOLOCK here is incorrect. Found by fuzzing u3.sfdir3.list[1].name = zeroes in xfs/1546. Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
1 parent 6691753 commit b44bfc0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/xfs/scrub/orphanage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ xrep_adoption_trans_alloc(
382382
out_cancel:
383383
xchk_trans_cancel(sc);
384384
xrep_orphanage_iunlock(sc, XFS_ILOCK_EXCL);
385-
xrep_orphanage_iunlock(sc, XFS_IOLOCK_EXCL);
385+
xchk_iunlock(sc, XFS_ILOCK_EXCL);
386386
return error;
387387
}
388388

0 commit comments

Comments
 (0)