Skip to content

Commit 6691753

Browse files
author
Darrick J. Wong
committed
xfs: drop the scrub file's iolock when transaction allocation fails
If the transaction allocation in the !orphanage_available case of xrep_nlinks_repair_inode fails, we need to drop the IOLOCK of the file being scrubbed before exiting. 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 4ad350a commit 6691753

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/xfs/scrub/nlinks_repair.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,10 @@ xrep_nlinks_repair_inode(
138138

139139
error = xfs_trans_alloc(mp, &M_RES(mp)->tr_link, 0, 0, 0,
140140
&sc->tp);
141-
if (error)
141+
if (error) {
142+
xchk_iunlock(sc, XFS_IOLOCK_EXCL);
142143
return error;
144+
}
143145

144146
xchk_ilock(sc, XFS_ILOCK_EXCL);
145147
xfs_trans_ijoin(sc->tp, ip, 0);

0 commit comments

Comments
 (0)