[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKFNMo=rL0tv1eUqHJ-KZXwZRuaJ3yWfWU8jzZaAgR3FU1DO7w@mail.gmail.com>
Date: Mon, 17 Jun 2024 20:24:23 +0900
From: Ryusuke Konishi <konishi.ryusuke@...il.com>
To: Jan Kara <jack@...e.cz>
Cc: Hillf Danton <hdanton@...a.com>, Matthew Wilcox <willy@...radead.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
syzbot+d79afb004be235636ee8@...kaller.appspotmail.com,
linux-fsdevel@...r.kernel.org, linux-nilfs@...r.kernel.org
Subject: Re: [RFC PATCH] mm: truncate: flush lru cache for evicted inode
On Mon, Jun 17, 2024 at 4:57 PM Jan Kara wrote:
>
> On Sun 16-06-24 10:39:51, Hillf Danton wrote:
> > On Sat, 15 Jun 2024 21:44:54 +0100 Matthew Wilcox wrote:
> > >
> > > I suspect this would trigger:
> > >
> > > +++ b/fs/inode.c
> > > @@ -282,6 +282,7 @@ static struct inode *alloc_inode(struct super_block *sb)
> > > void __destroy_inode(struct inode *inode)
> > > {
> > > BUG_ON(inode_has_buffers(inode));
> > > + BUG_ON(inode->i_data.nrpages);
> > > inode_detach_wb(inode);
> > > security_inode_free(inode);
> > > fsnotify_inode_delete(inode);
> > >
> > Yes, it was triggered [1]
> >
> > [1] https://lore.kernel.org/lkml/00000000000084b401061af6ab80@google.com/
> >
> > and given trigger after nrpages is checked in clear_inode(),
> >
> > iput(inode)
> > evict(inode)
> > truncate_inode_pages_final(&inode->i_data);
> > clear_inode(inode);
> > destroy_inode(inode);
> >
> > why is folio added to exiting mapping?
> >
> > #syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 83a7eefedc9b
>
> OK, so based on syzbot results this seems to be a bug in
> nilfs_evict_inode() (likely caused by corrupted filesystem so that root
> inode's link count was 0 and hence was getting deleted on iput()). I guess
> nilfs maintainers need to address these with more consistency checks of
> metadata when loading them...
>
> Honza
> --
> Jan Kara <jack@...e.com>
> SUSE Labs, CR
Sorry for my late response.
Also, thank you for pointing out that the problem seems to be caused
via nilfs_evict_inode() by a missing consistency check of the link
count.
I'll check it out and think about how to deal with it.
Thanks,
Ryusuke Konishi
Powered by blists - more mailing lists