public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: xiakaixu1987@gmail.com
Cc: linux-xfs@vger.kernel.org, djwong@kernel.org, hch@infradead.org,
	Kaixu Xia <kaixuxia@tencent.com>
Subject: Re: [RESEND PATCH 2/2] xfs: use invalidate_lock to check the state of mmap_lock
Date: Sat, 18 Jun 2022 08:06:45 +1000	[thread overview]
Message-ID: <20220617220645.GJ227878@dread.disaster.area> (raw)
In-Reply-To: <1655433034-17934-3-git-send-email-kaixuxia@tencent.com>

On Fri, Jun 17, 2022 at 10:30:34AM +0800, xiakaixu1987@gmail.com wrote:
> From: Kaixu Xia <kaixuxia@tencent.com>
> 
> 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@tencent.com>
> ---
>  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@redhat.com>

-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2022-06-17 22:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-17  2:30 [RESEND PATCH 0/2] xfs: random fixes for lock flags xiakaixu1987
2022-06-17  2:30 ` [RESEND PATCH 1/2] xfs: factor out the common lock flags assert xiakaixu1987
2022-06-17 22:04   ` Dave Chinner
2022-06-17  2:30 ` [RESEND PATCH 2/2] xfs: use invalidate_lock to check the state of mmap_lock xiakaixu1987
2022-06-17 22:06   ` Dave Chinner [this message]
2022-06-22 23:28 ` [RESEND PATCH 0/2] xfs: random fixes for lock flags Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220617220645.GJ227878@dread.disaster.area \
    --to=david@fromorbit.com \
    --cc=djwong@kernel.org \
    --cc=hch@infradead.org \
    --cc=kaixuxia@tencent.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=xiakaixu1987@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox