[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJnrk1aQwfvb51wQ5rUSf9N8j1hArTFeSkHqC_3T-mU6_BCD=A@mail.gmail.com>
Date: Fri, 18 Oct 2024 11:13:02 -0700
From: Joanne Koong <joannelkoong@...il.com>
To: Miklos Szeredi <miklos@...redi.hu>
Cc: syzbot <syzbot+217a976dc26ef2fa8711@...kaller.appspotmail.com>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [fuse?] WARNING in fuse_writepages
On Fri, Oct 18, 2024 at 3:54 AM Miklos Szeredi <miklos@...redi.hu> wrote:
>
> On Fri, 4 Oct 2024 at 21:04, Joanne Koong <joannelkoong@...il.com> wrote:
>
> > > The warning is complaining about this WARN_ON here
> > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/fuse/file.c#n1989.
> > > I think this warning can get triggered if there's a race between a
> > > write() and a close() where the page is dirty in the cache after the
> > > release has happened. Then when writeback (eg fuse_writepages()) is
> > > triggered, we hit this warning. (this possibility has always existed,
> > > it was surfaced after this refactoring commit 4046d3adcca4: "move fuse
> > > file initialization to wpa allocation time" but the actual logic
> > > hasn't been changed).
> >
> > Actually, it's not clear how this WARN_ON is getting triggered.
> >
> > I will wait for syzbot to surface a repro first before taking further action.
>
> I think the issue is that fuse_writepages() might be called with no
> dirty pages after all writable opens were closed. The exact mechanism
> is unclear, but it's pretty likely that this is the case.
>
> Commit 672c3b7457fc ("fuse: move initialization of fuse_file to
> fuse_writepages() instead of in callback") broke this case.
>
> Maybe reverting this is the simplest fix?
Reverting this sounds good to me.
I guess we don't run into this warning in the original code because if
there are no dirty pages, write_cache_pages() calls into
folio_prepare_writeback() which skips the folio if it's not dirty.
Thanks,
Joanne
>
> Thanks,
> Miklos
Powered by blists - more mailing lists