Re: [External] Re: [PATCH v2] ext4: make dioread_nolock consistent in each mapping round

From: hanjinke
Date: Thu Feb 16 2023 - 11:10:52 EST




在 2023/2/16 下午9:13, Ritesh Harjani (IBM) 写道:
Jinke Han <hanjinke.666@xxxxxxxxxxxxx> writes:

From: Jinke Han <hanjinke.666@xxxxxxxxxxxxx>

When disable and enable dioread_nolock by remount, we may see
dioread_lock in ext4_do_writepages while see dioread_nolock in
mpage_map_one_extent. This inconsistency may triger the warning
in ext4_add_complete_io when the io_end->handle is NULL. Although
this warning is harmless in most cases, there is still a risk of
insufficient log reservation in conversion of unwritten extents.


Sorry, I haven't completely gone through the patch yet. But this idea of
caching the initial value of mount parameter and passing it do different
functions while an I/O request completes, is not looking right to me.

If that's the case shouldn't we disallow this mount option to change
until all the outstanding I/O's are done or complete?
Then we need not cache the value of dioread_nolock at the start of
writepages and continue to pass it down in case it it changes.

Just my initial thoughts.

-ritesh


Fair enough, thanks.