linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joanne Koong <joannelkoong@gmail.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: syzbot <syzbot+217a976dc26ef2fa8711@syzkaller.appspotmail.com>,
	 linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	 syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [fuse?] WARNING in fuse_writepages
Date: Fri, 18 Oct 2024 11:13:02 -0700	[thread overview]
Message-ID: <CAJnrk1aQwfvb51wQ5rUSf9N8j1hArTFeSkHqC_3T-mU6_BCD=A@mail.gmail.com> (raw)
In-Reply-To: <CAJfpegu=U7sdWvw63ULkr=5T05cqVd3H9ytPOPrkLtwUwsy5Kw@mail.gmail.com>

On Fri, Oct 18, 2024 at 3:54 AM Miklos Szeredi <miklos@szeredi.hu> wrote:
>
> On Fri, 4 Oct 2024 at 21:04, Joanne Koong <joannelkoong@gmail.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

  reply	other threads:[~2024-10-18 18:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-01 19:20 [syzbot] [fuse?] WARNING in fuse_writepages syzbot
2024-10-02  0:02 ` Joanne Koong
2024-10-04 19:04   ` Joanne Koong
2024-10-18 10:54     ` Miklos Szeredi
2024-10-18 18:13       ` Joanne Koong [this message]
2024-10-21 10:42         ` Miklos Szeredi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJnrk1aQwfvb51wQ5rUSf9N8j1hArTFeSkHqC_3T-mU6_BCD=A@mail.gmail.com' \
    --to=joannelkoong@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=syzbot+217a976dc26ef2fa8711@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).