xfs: fix iunlock calls in xrep_adoption_trans_alloc
authorDarrick J. Wong <djwong@kernel.org>
Mon, 22 Apr 2024 16:48:28 +0000 (09:48 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 23 Apr 2024 23:55:19 +0000 (16:55 -0700)
commitb44bfc06958f49ccb611632a4fb7c7df4fdcbc06
treebb0ec78282155688107a0060025c5c5781780240
parent66917537522312a6e462787f0f347d6998cf7038
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>
fs/xfs/scrub/orphanage.c