summaryrefslogtreecommitdiff
path: root/fs/xfs/scrub/orphanage.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2024-04-22 09:48:28 -0700
committerDarrick J. Wong <djwong@kernel.org>2024-04-23 16:55:19 -0700
commitb44bfc06958f49ccb611632a4fb7c7df4fdcbc06 (patch)
treebb0ec78282155688107a0060025c5c5781780240 /fs/xfs/scrub/orphanage.c
parent66917537522312a6e462787f0f347d6998cf7038 (diff)
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 <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/scrub/orphanage.c')
-rw-r--r--fs/xfs/scrub/orphanage.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/scrub/orphanage.c b/fs/xfs/scrub/orphanage.c
index b1c6c60ee1da..2b142e6de8f3 100644
--- a/fs/xfs/scrub/orphanage.c
+++ b/fs/xfs/scrub/orphanage.c
@@ -382,7 +382,7 @@ xrep_adoption_trans_alloc(
out_cancel:
xchk_trans_cancel(sc);
xrep_orphanage_iunlock(sc, XFS_ILOCK_EXCL);
- xrep_orphanage_iunlock(sc, XFS_IOLOCK_EXCL);
+ xchk_iunlock(sc, XFS_ILOCK_EXCL);
return error;
}