public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
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 v2 1/1] writeback: don't block sync(2) for filesystems with no data integrity guarantees
Date: Thu, 19 Mar 2026 22:26:03 +0100	[thread overview]
Message-ID: <1f1dafa7-54c7-4eae-a19e-5ec1be391079@kernel.org> (raw)
In-Reply-To: <20260319194540.3463371-2-joannelkoong@gmail.com>

On 3/19/26 20:45, 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(2) 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 allows us to skip the logic in
> sync_inodes_sb() entirely, rather than iterating every dirty inode in
> wait_sb_inodes() only to skip each inode individually.

Makes sense to me.

[...]

>  	if (sb->s_user_ns != &init_user_ns)
>  		sb->s_iflags |= SB_I_UNTRUSTED_MOUNTER;
>  	sb->s_flags &= ~(SB_NOSEC | SB_I_VERSION);
> diff --git a/fs/sync.c b/fs/sync.c
> index 942a60cfedfb..aedbf723830a 100644
> --- a/fs/sync.c
> +++ b/fs/sync.c
> @@ -73,7 +73,12 @@ EXPORT_SYMBOL(sync_filesystem);
>  
>  static void sync_inodes_one_sb(struct super_block *sb, void *arg)
>  {
> -	if (!sb_rdonly(sb))
> +	if (sb_rdonly(sb))
> +		return;
> +

Should we move some of the comment you deleting over here?

> +	if (sb->s_iflags & SB_I_NO_DATA_INTEGRITY)
> +		wakeup_flusher_threads_bdi(sb->s_bdi, WB_REASON_SYNC);
> +	else
>  		sync_inodes_sb(sb);
>  }
I was wondering whether that handling should be moved to
sync_inodes_sb(), so it would catch any (existing+future) callers.

Alternatively, we could catch abuse by adding a warning to sync_inodes_sb.

-- 
Cheers,

David

  reply	other threads:[~2026-03-19 21:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-19 19:45 [PATCH v2 0/1] writeback: don't block sync(2) for filesystems with no data integrity guarantees Joanne Koong
2026-03-19 19:45 ` [PATCH v2 1/1] " Joanne Koong
2026-03-19 21:26   ` David Hildenbrand (Arm) [this message]
2026-03-19 23:55     ` 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=1f1dafa7-54c7-4eae-a19e-5ec1be391079@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