diff options
author | Darrick J. Wong <djwong@kernel.org> | 2024-04-22 09:48:27 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2024-04-23 16:55:18 -0700 |
commit | 66917537522312a6e462787f0f347d6998cf7038 (patch) | |
tree | ac4a249854e0f2b3a1230e78278c76ed67b93a0f /fs/xfs/scrub | |
parent | 4ad350ac58627bfe81f71f43f6738e36b4eb75c6 (diff) | |
download | linux-66917537522312a6e462787f0f347d6998cf7038.tar.gz linux-66917537522312a6e462787f0f347d6998cf7038.tar.bz2 linux-66917537522312a6e462787f0f347d6998cf7038.zip |
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 <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/scrub')
-rw-r--r-- | fs/xfs/scrub/nlinks_repair.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/xfs/scrub/nlinks_repair.c b/fs/xfs/scrub/nlinks_repair.c index 78d0f650fe89..b3e707f47b7b 100644 --- a/fs/xfs/scrub/nlinks_repair.c +++ b/fs/xfs/scrub/nlinks_repair.c @@ -138,8 +138,10 @@ xrep_nlinks_repair_inode( error = xfs_trans_alloc(mp, &M_RES(mp)->tr_link, 0, 0, 0, &sc->tp); - if (error) + if (error) { + xchk_iunlock(sc, XFS_IOLOCK_EXCL); return error; + } xchk_ilock(sc, XFS_ILOCK_EXCL); xfs_trans_ijoin(sc->tp, ip, 0); |