xfs: use invalidate_lock to check the state of mmap_lock

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.

Fixes: 2433480a7e ("xfs: Convert to use invalidate_lock")
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
This commit is contained in:
Kaixu Xia 2022-06-19 14:53:43 -07:00 committed by Darrick J. Wong
parent ca76a761ea
commit 82af880639

View File

@ -365,8 +365,8 @@ xfs_isilocked(
} }
if (lock_flags & (XFS_MMAPLOCK_EXCL|XFS_MMAPLOCK_SHARED)) { if (lock_flags & (XFS_MMAPLOCK_EXCL|XFS_MMAPLOCK_SHARED)) {
return __xfs_rwsem_islocked(&VFS_I(ip)->i_rwsem, return __xfs_rwsem_islocked(&VFS_I(ip)->i_mapping->invalidate_lock,
(lock_flags & XFS_IOLOCK_SHARED)); (lock_flags & XFS_MMAPLOCK_SHARED));
} }
if (lock_flags & (XFS_IOLOCK_EXCL | XFS_IOLOCK_SHARED)) { if (lock_flags & (XFS_IOLOCK_EXCL | XFS_IOLOCK_SHARED)) {