From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Joanne Koong <joannelkoong@gmail.com>, brauner@kernel.org
Cc: linux-fsdevel@vger.kernel.org, jack@suse.cz, miklos@szeredi.hu,
therealgraysky@proton.me, linux-pm@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH v3 1/1] writeback: don't block sync for filesystems with no data integrity guarantees
Date: Fri, 20 Mar 2026 09:12:41 +0100 [thread overview]
Message-ID: <ec90f34e-1f99-4ded-ba65-6d4345552ab3@kernel.org> (raw)
In-Reply-To: <20260320005145.2483161-2-joannelkoong@gmail.com>
On 3/20/26 01:51, Joanne Koong wrote:
> Add a SB_I_NO_DATA_INTEGRITY superblock flag for filesystems that cannot
> guarantee data persistence on sync (eg fuse). For superblocks with this
> flag set, sync kicks off writeback of dirty inodes but does not wait
> for the flusher threads to complete the writeback.
>
> This replaces the per-inode AS_NO_DATA_INTEGRITY mapping flag added in
> commit f9a49aa302a0 ("fs/writeback: skip AS_NO_DATA_INTEGRITY mappings
> in wait_sb_inodes()"). The flag belongs at the superblock level because
> data integrity is a filesystem-wide property, not a per-inode one.
> Having this flag at the superblock level also allows us to skip having
> to iterate every dirty inode in wait_sb_inodes() only to skip each inode
> individually.
>
> Prior to this commit, mappings with no data integrity guarantees skipped
> waiting on writeback completion but still waited on the flusher threads
> to finish initiating the writeback. Waiting on the flusher threads is
> unnecessary. This commit kicks off writeback but does not wait on the
> flusher threads. This change properly addresses a recent report [1] for
> a suspend-to-RAM hang seen on fuse-overlayfs that was caused by waiting
> on the flusher threads to finish:
>
> Workqueue: pm_fs_sync pm_fs_sync_work_fn
> Call Trace:
> <TASK>
> __schedule+0x457/0x1720
> schedule+0x27/0xd0
> wb_wait_for_completion+0x97/0xe0
> sync_inodes_sb+0xf8/0x2e0
> __iterate_supers+0xdc/0x160
> ksys_sync+0x43/0xb0
> pm_fs_sync_work_fn+0x17/0xa0
> process_one_work+0x193/0x350
> worker_thread+0x1a1/0x310
> kthread+0xfc/0x240
> ret_from_fork+0x243/0x280
> ret_from_fork_asm+0x1a/0x30
> </TASK>
>
> On fuse this is problematic because there are paths that may cause the
> flusher thread to block (eg if systemd freezes the user session cgroups
> first, which freezes the fuse daemon, before invoking the kernel
> suspend. The kernel suspend triggers ->write_node() which on fuse issues
> a synchronous setattr request, which cannot be processed since the
> daemon is frozen. Or if the daemon is buggy and cannot properly complete
> writeback, initiating writeback on a dirty folio already under writeback
> leads to writeback_get_folio() -> folio_prepare_writeback() ->
> unconditional wait on writeback to finish, which will cause a hang).
> This commit restores fuse to its prior behavior before tmp folios were
> removed, where sync was essentially a no-op.
>
> [1] https://lore.kernel.org/linux-fsdevel/CAJnrk1a-asuvfrbKXbEwwDSctvemF+6zfhdnuzO65Pt8HsFSRw@mail.gmail.com/T/#m632c4648e9cafc4239299887109ebd880ac6c5c1
>
> Fixes: 0c58a97f919c ("fuse: remove tmp folio for writebacks and internal rb tree")
> Reported-by: John <therealgraysky@proton.me>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
> ---
Looks reasonable to me. With my little experience in fs land:
Reviewed-by: David Hildenbrand (Arm) <david@kernel.org>
--
Cheers,
David
next prev parent reply other threads:[~2026-03-20 8:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260320005145.2483161-1-joannelkoong@gmail.com>
2026-03-20 0:51 ` [PATCH v3 1/1] writeback: don't block sync for filesystems with no data integrity guarantees Joanne Koong
2026-03-20 8:12 ` David Hildenbrand (Arm) [this message]
2026-03-20 10:16 ` Jan Kara
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=ec90f34e-1f99-4ded-ba65-6d4345552ab3@kernel.org \
--to=david@kernel.org \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=joannelkoong@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=stable@vger.kernel.org \
--cc=therealgraysky@proton.me \
/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