From: Joanne Koong <joannelkoong@gmail.com>
To: "David Hildenbrand (Red Hat)" <david@kernel.org>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
shakeel.butt@linux.dev, athul.krishna.kr@protonmail.com,
miklos@szeredi.hu, stable@vger.kernel.org
Subject: Re: [PATCH v1 2/2] fs/writeback: skip inodes with potential writeback hang in wait_sb_inodes()
Date: Thu, 20 Nov 2025 13:20:33 -0800 [thread overview]
Message-ID: <CAJnrk1Zsdw9Uvb44ynkfWLBvs2vw7he-opVu6mzJqokphMiLSQ@mail.gmail.com> (raw)
In-Reply-To: <5c1630ac-d304-4854-9ba6-5c9cc1f78be5@kernel.org>
On Thu, Nov 20, 2025 at 12:23 PM David Hildenbrand (Red Hat)
<david@kernel.org> wrote:
>
> On 11/20/25 19:42, Joanne Koong wrote:
> > During superblock writeback waiting, skip inodes where writeback may
> > take an indefinite amount of time or hang, as denoted by the
> > AS_WRITEBACK_MAY_HANG mapping flag.
> >
> > Currently, fuse is the only filesystem with this flag set. For a
> > properly functioning fuse server, writeback requests are completed and
> > there is no issue. However, if there is a bug in the fuse server and it
> > hangs on writeback, then without this change, wait_sb_inodes() will wait
> > forever.
> >
> > Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
> > Fixes: 0c58a97f919c ("fuse: remove tmp folio for writebacks and internal rb tree")
> > Reported-by: Athul Krishna <athul.krishna.kr@protonmail.com>
> > ---
> > fs/fs-writeback.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
> > index 2b35e80037fe..eb246e9fbf3d 100644
> > --- a/fs/fs-writeback.c
> > +++ b/fs/fs-writeback.c
> > @@ -2733,6 +2733,9 @@ static void wait_sb_inodes(struct super_block *sb)
> > if (!mapping_tagged(mapping, PAGECACHE_TAG_WRITEBACK))
> > continue;
> >
> > + if (mapping_writeback_may_hang(mapping))
> > + continue;
>
> I think I raised it in the past, but simply because it could happen, why
> would we unconditionally want to do that for all fuse mounts? That just
> seems wrong :(
I think it's considered a userspace regression if we don't revert the
program behavior back to its previous version, even if it is from the
program being incorrectly written, as per the conversation in [1].
[1] https://lore.kernel.org/regressions/CAJnrk1Yh4GtF-wxWo_2ffbr90R44u0WDmMAEn9vr9pFgU0Nc6w@mail.gmail.com/T/#m73cf4b4828d51553caad3209a5ac92bca78e15d2
>
> To phrase it in a different way, if any writeback could theoretically
> hang, why are we even waiting on writeback in the first place?
>
I think it's because on other filesystems, something has to go
seriously wrong for writeback to hang, but on fuse a server can easily
make writeback hang and as it turns out, there are already existing
userspace programs that do this accidentally.
Thanks,
Joanne
> --
> Cheers
>
> David
next prev parent reply other threads:[~2025-11-20 21:27 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-20 18:42 [PATCH v1 0/2] mm: skip wait in wait_sb_inodes() for hangable-writeback mappings Joanne Koong
2025-11-20 18:42 ` [PATCH v1 1/2] mm: rename AS_WRITEBACK_MAY_DEADLOCK_ON_RECLAIM to AS_WRITEBACK_MAY_HANG Joanne Koong
2025-11-20 20:08 ` David Hildenbrand (Red Hat)
2025-11-20 21:28 ` Joanne Koong
2025-11-20 18:42 ` [PATCH v1 2/2] fs/writeback: skip inodes with potential writeback hang in wait_sb_inodes() Joanne Koong
2025-11-20 20:23 ` David Hildenbrand (Red Hat)
2025-11-20 21:20 ` Joanne Koong [this message]
2025-11-24 13:58 ` David Hildenbrand (Red Hat)
2025-11-25 1:10 ` Joanne Koong
2025-11-26 10:19 ` Miklos Szeredi
2025-11-26 10:41 ` David Hildenbrand (Red Hat)
2025-11-26 10:55 ` David Hildenbrand (Red Hat)
2025-11-26 17:58 ` Joanne Koong
2025-12-03 9:28 ` Miklos Szeredi
2025-12-04 18:06 ` Joanne Koong
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=CAJnrk1Zsdw9Uvb44ynkfWLBvs2vw7he-opVu6mzJqokphMiLSQ@mail.gmail.com \
--to=joannelkoong@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=athul.krishna.kr@protonmail.com \
--cc=david@kernel.org \
--cc=linux-mm@kvack.org \
--cc=miklos@szeredi.hu \
--cc=shakeel.butt@linux.dev \
--cc=stable@vger.kernel.org \
/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