Re: [RESEND PATCH 2/2] xfs: use invalidate_lock to check the state of mmap_lock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 17, 2022 at 10:30:34AM +0800, xiakaixu1987@xxxxxxxxx wrote:
> From: Kaixu Xia <kaixuxia@xxxxxxxxxxx>
> 
> We should use invalidate_lock and XFS_MMAPLOCK_SHARED to check the state
> of mmap_lock rw_semaphore in xfs_isilocked(), rather than i_rwsem and
> XFS_IOLOCK_SHARED.
> 
> Signed-off-by: Kaixu Xia <kaixuxia@xxxxxxxxxxx>
> ---
>  fs/xfs/xfs_inode.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
> index 8b8bac7eba8c..3e1c62ffa4f7 100644
> --- a/fs/xfs/xfs_inode.c
> +++ b/fs/xfs/xfs_inode.c
> @@ -365,8 +365,8 @@ xfs_isilocked(
>  	}
>  
>  	if (lock_flags & (XFS_MMAPLOCK_EXCL|XFS_MMAPLOCK_SHARED)) {
> -		return __xfs_rwsem_islocked(&VFS_I(ip)->i_rwsem,
> -				(lock_flags & XFS_IOLOCK_SHARED));
> +		return __xfs_rwsem_islocked(&VFS_I(ip)->i_mapping->invalidate_lock,
> +				(lock_flags & XFS_MMAPLOCK_SHARED));

Looks good.

Fixes: 2433480a7e1d ("xfs: Convert to use invalidate_lock")

Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>

-- 
Dave Chinner
david@xxxxxxxxxxxxx



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux