All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: fix a missing unlock on error in xfs_fs_map_blocks
@ 2020-11-11  9:43 Christoph Hellwig
  2020-11-11 16:07 ` Darrick J. Wong
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2020-11-11  9:43 UTC (permalink / raw)
  To: linux-xfs

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>
---
 fs/xfs/xfs_pnfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_pnfs.c b/fs/xfs/xfs_pnfs.c
index b101feb2aab452..f3082a957d5e1a 100644
--- a/fs/xfs/xfs_pnfs.c
+++ b/fs/xfs/xfs_pnfs.c
@@ -134,7 +134,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);
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] xfs: fix a missing unlock on error in xfs_fs_map_blocks
  2020-11-11  9:43 [PATCH] xfs: fix a missing unlock on error in xfs_fs_map_blocks Christoph Hellwig
@ 2020-11-11 16:07 ` Darrick J. Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Darrick J. Wong @ 2020-11-11 16:07 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-xfs

On Wed, Nov 11, 2020 at 10:43:26AM +0100, Christoph Hellwig wrote:
> 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>

Looks good to me,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
>  fs/xfs/xfs_pnfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/xfs_pnfs.c b/fs/xfs/xfs_pnfs.c
> index b101feb2aab452..f3082a957d5e1a 100644
> --- a/fs/xfs/xfs_pnfs.c
> +++ b/fs/xfs/xfs_pnfs.c
> @@ -134,7 +134,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);
> -- 
> 2.28.0
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-11 16:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-11  9:43 [PATCH] xfs: fix a missing unlock on error in xfs_fs_map_blocks Christoph Hellwig
2020-11-11 16:07 ` Darrick J. Wong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.