Re: [PATCH] fs: revert insert_inode_locked() eviction wait change and explain why
From: Jan Kara
Date: Tue Mar 17 2026 - 09:41:29 EST
On Tue 17-03-26 14:12:48, Mateusz Guzik wrote:
> On Tue, Mar 17, 2026 at 2:01 PM Jan Kara <jack@xxxxxxx> wrote:
> >
> > On Mon 16-03-26 11:33:05, Mateusz Guzik wrote:
> > > It causes a deadlock, reproducer can be found here:
> > > https://lore.kernel.org/linux-fsdevel/abNvb2PcrKj1FBeC@ly-workstation/
> > >
> > > The real bug is in ext4, but I'm not digging into it and a working order
> > > needs to be restored.
> >
> > I can dig into that. I expect ext4 ends up calling find_inode() from its
> > ext4_evict_inode() handler or something like that? I was searching for such
> > occurrence for a while but I didn't find it so can you share where ext4
> > blocked? Because the stacktraces from the original report just show the
> > journalling machinery hangs but those are only side-effects of somebody
> > hanging in ext4 with the transaction handle started... Thanks!
> all traces attached
Thanks! OK, for reference the inode has been marked as 'sync' so
ext4_evict_inode() -> ext4_journal_stop()
ends up waiting for transaction commit. However ext4_new_inode() calls
insert_inode_locked() with started transaction handle and thus waits for
the freeing inode with the handle started. Classical ABBA deadlock. I'll
think how we could sensibly fix this in ext4.
Honza
--
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR