xfs: unlock new repair tempfiles after creation
authorDarrick J. Wong <djwong@kernel.org>
Mon, 15 Apr 2024 21:55:16 +0000 (14:55 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Mon, 15 Apr 2024 21:59:03 +0000 (14:59 -0700)
After creation, drop the ILOCK on temporary files that have been created
to stage a repair.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/scrub/tempfile.c

index c72e447eb8ec393892db270edcb9fe15187638f9..6f39504a216eaee3cd4463f48edd47dc3946d92c 100644 (file)
@@ -153,6 +153,7 @@ xrep_tempfile_create(
        xfs_qm_dqrele(pdqp);
 
        /* Finish setting up the incore / vfs context. */
+       xfs_iunlock(sc->tempip, XFS_ILOCK_EXCL);
        xfs_setup_iops(sc->tempip);
        xfs_finish_inode_setup(sc->tempip);
 
@@ -168,6 +169,7 @@ out_release_inode:
         * transactions and deadlocks from xfs_inactive.
         */
        if (sc->tempip) {
+               xfs_iunlock(sc->tempip, XFS_ILOCK_EXCL);
                xfs_finish_inode_setup(sc->tempip);
                xchk_irele(sc, sc->tempip);
        }