[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <qajqa3mduefflh3ki522gpmhb5kunreidbj2rsfzjntec3ur5k@epwgj76rbam5>
Date: Tue, 4 Nov 2025 13:07:46 +0100
From: Jan Kara <jack@...e.cz>
To: Mateusz Guzik <mjguzik@...il.com>
Cc: brauner@...nel.org, viro@...iv.linux.org.uk, jack@...e.cz,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH v3] fs: push list presence check into inode_io_list_del()
On Tue 04-11-25 00:09:11, Mateusz Guzik wrote:
> For consistency with sb routines.
>
> ext4 is the only consumer outside of evict(). Damage-controlling it is
> outside of the scope of this cleanup.
>
> Signed-off-by: Mateusz Guzik <mjguzik@...il.com>
Thanks. Feel free to add:
Reviewed-by: Jan Kara <jack@...e.cz>
One note below:
> diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
> index f784d8b09b04..e2eed66aabf8 100644
> --- a/fs/fs-writeback.c
> +++ b/fs/fs-writeback.c
> @@ -1349,6 +1349,13 @@ void inode_io_list_del(struct inode *inode)
> {
> struct bdi_writeback *wb;
>
> + /*
> + * FIXME: ext4 can call here from ext4_evict_inode() after evict() already
> + * unlinked the inode.
> + */
This is in fact due to a possible race between __mark_inode_dirty() called
from ending page writeback (which is perfectly legal for a filesystem to
do) and iput_final() + evict(). See bc12ac98ea2e ("ext4: silence the
warning when evicting inode with dioread_nolock") for details. So proper
solution should be in the generic code... E.g. checking emptiness of
i_io_list under i_lock should be enough to close the race but it's a bit
tricky to avoid the unnecessary lock roundtrip for clean inodes.
Honza
--
Jan Kara <jack@...e.com>
SUSE Labs, CR
Powered by blists - more mailing lists