linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: hongnanli <hongnan.li@linux.alibaba.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH] fs/xfs: fix comments mentioning i_mutex
Date: Fri, 21 Jan 2022 12:28:22 -0800	[thread overview]
Message-ID: <20220121202822.GS13540@magnolia> (raw)
In-Reply-To: <20220121071505.31930-1-hongnan.li@linux.alibaba.com>

On Fri, Jan 21, 2022 at 03:15:05PM +0800, hongnanli wrote:
> inode->i_mutex has been replaced with inode->i_rwsem long ago. Fix
> comments still mentioning i_mutex.
> 
> Signed-off-by: hongnanli <hongnan.li@linux.alibaba.com>
> ---
>  fs/xfs/xfs_acl.c   | 2 +-
>  fs/xfs/xfs_iomap.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c
> index 5c52ee869272..b02c83f8b8c4 100644
> --- a/fs/xfs/xfs_acl.c
> +++ b/fs/xfs/xfs_acl.c
> @@ -22,7 +22,7 @@
>  
>  /*
>   * Locking scheme:
> - *  - all ACL updates are protected by inode->i_mutex, which is taken before
> + *  - all ACL updates are protected by inode->i_rwsem, which is taken before

This should use more general terminology here, such as "VFS inode lock"
or "IOLOCK" (XFS-specific shorthand), since the implementation may
change again in the future.

--D

>   *    calling into this file.
>   */
>  
> diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
> index e552ce541ec2..288a5cdcaa61 100644
> --- a/fs/xfs/xfs_iomap.c
> +++ b/fs/xfs/xfs_iomap.c
> @@ -1126,7 +1126,7 @@ xfs_buffered_write_iomap_end(
>  	 * Trim delalloc blocks if they were allocated by this write and we
>  	 * didn't manage to write the whole range.
>  	 *
> -	 * We don't need to care about racing delalloc as we hold i_mutex
> +	 * We don't need to care about racing delalloc as we hold i_rwsem
>  	 * across the reserve/allocate/unreserve calls. If there are delalloc
>  	 * blocks in the range, they are ours.
>  	 */
> -- 
> 2.19.1.6.gb485710b
> 

      reply	other threads:[~2022-01-21 20:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-21  7:15 [PATCH] fs/xfs: fix comments mentioning i_mutex hongnanli
2022-01-21 20:28 ` Darrick J. Wong [this message]

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=20220121202822.GS13540@magnolia \
    --to=djwong@kernel.org \
    --cc=hongnan.li@linux.alibaba.com \
    --cc=linux-xfs@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).