Re: [PATCH v2] docs/vfs: update references to i_mutex to i_rwsem

From: Junxuan Liao
Date: Wed Jun 25 2025 - 14:52:13 EST


Hi Christian and Jan,

On 6/23/25 6:09 AM, Jan Kara wrote:
> One comment below. Christian, can you please fix it up? Otherwise feel free
> to add:
>
> Reviewed-by: Jan Kara <jack@xxxxxxx>
>
>> 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.

Sorry I missed that part. Could you please fix this in the commit?

--
Thanks,
Junxuan