[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fduatokkcmrhtndxbmkcarycto5su7gb7jfkcb53gvzflj5o5a@itnis2jwtdt6>
Date: Mon, 16 Jun 2025 12:10:40 +0200
From: Jan Kara <jack@...e.cz>
To: Junxuan Liao <ljx@...wisc.edu>
Cc: linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
linux-fsdevel@...r.kernel.org, "Matthew Wilcox (Oracle)" <willy@...radead.org>,
Jonathan Corbet <corbet@....net>, Alexander Viro <viro@...iv.linux.org.uk>,
Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>
Subject: Re: [PATCH 1/1] docs/vfs: update references to i_mutex to i_rwsem
On Sun 15-06-25 21:16:53, Junxuan Liao wrote:
> VFS has switched to i_rwsem for ten years now (9902af79c01a: parallel
> lookups actual switch to rwsem), but the VFS documentation and comments
> still has references to i_mutex.
>
> Signed-off-by: Junxuan Liao <ljx@...wisc.edu>
Thanks. This cleanup is long overdue :).
> diff --git a/Documentation/filesystems/vfs.rst b/Documentation/filesystems/vfs.rst
> index fd32a9a17bfb..a09c4aab9b5b 100644
> --- a/Documentation/filesystems/vfs.rst
> +++ b/Documentation/filesystems/vfs.rst
> @@ -759,7 +759,7 @@ dirty_folio to write data into the address_space, and
> writepages to writeback data to storage.
>
> Adding and removing pages to/from an address_space is protected by the
> -inode's i_mutex.
> +inode's i_rwsem.
It is not your fault but this sentence is not actually true. i_rwsem is
held exlusively when removing pages from an address space. However i_rwsem
is often not held at all when adding pages to an address space.
mapping->invalidate_lock is used for that.
> diff --git a/fs/attr.c b/fs/attr.c
> index 9caf63d20d03..3a3881d3147f 100644
> --- a/fs/attr.c
> +++ b/fs/attr.c
> @@ -230,7 +230,7 @@ EXPORT_SYMBOL(setattr_prepare);
> * @inode: the inode to be truncated
> * @offset: the new size to assign to the inode
> *
> - * inode_newsize_ok must be called with i_mutex held.
> + * inode_newsize_ok must be called with i_rwsem held.
I guess we can add "exclusively" here.
Otherwise the changes look good to me.
Honza
--
Jan Kara <jack@...e.com>
SUSE Labs, CR
Powered by blists - more mailing lists