[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <bi5e6qyg6htcmuocfahgvwxx2djxyeorhlc425y72pggmvw4hi@dzfheotxoz7j>
Date: Mon, 23 Jun 2025 13:09:39 +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 v2] docs/vfs: update references to i_mutex to i_rwsem
On Sun 22-06-25 23:01:32, 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>
One comment below. Christian, can you please fix it up? Otherwise feel free
to add:
Reviewed-by: Jan Kara <jack@...e.cz>
> diff --git a/Documentation/filesystems/vfs.rst b/Documentation/filesystems/vfs.rst
> index fd32a9a17bfb..dd9da7e04a99 100644
> --- a/Documentation/filesystems/vfs.rst
> +++ b/Documentation/filesystems/vfs.rst
> @@ -758,8 +758,9 @@ process is more complicated and uses write_begin/write_end or
> 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.
> +Removing pages from an address_space requires holding the inode's i_rwsem
> +exclusively, while adding pages to the address_space requires holding the
> +inode's i_mapping->invalidate_lock exclusively.
I wasn't probably precise enough in my previous comment. This paragraph
should be:
Removing pages from an address_space requires holding the inode's i_rwsem
exclusively and i_mapping->invalidate_lock exclusively. Adding pages to the
address_space requires either holding inode's i_rwsem exclusively or
i_mapping->invalidate_lock in shared mode.
Honza
--
Jan Kara <jack@...e.com>
SUSE Labs, CR
Powered by blists - more mailing lists