]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
xfs: fix a missing unlock on error in xfs_fs_map_blocks
authorChristoph Hellwig <hch@lst.de>
Wed, 11 Nov 2020 16:07:37 +0000 (08:07 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Nov 2020 17:25:00 +0000 (18:25 +0100)
[ Upstream commit 2bd3fa793aaa7e98b74e3653fdcc72fa753913b5 ]

We also need to drop the iolock when invalidate_inode_pages2 fails, not
only on all other error or successful cases.

Fixes: 527851124d10 ("xfs: implement pNFS export operations")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/xfs/xfs_pnfs.c

index dc6221942b85f437767decfca9bf7ca9b0a94026..ab66ea0a72bfb0ddd99d4cd4b1ded0cf8b26ae2e 100644 (file)
@@ -162,7 +162,7 @@ xfs_fs_map_blocks(
                goto out_unlock;
        error = invalidate_inode_pages2(inode->i_mapping);
        if (WARN_ON_ONCE(error))
-               return error;
+               goto out_unlock;
 
        end_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)offset + length);
        offset_fsb = XFS_B_TO_FSBT(mp, offset);