Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
To: Jan Kara <jack@suse.cz>, Christian Brauner <brauner@kernel.org>
Cc: linux-fsdevel@vger.kernel.org,
	"Darrick J . Wong" <djwong@kernel.org>, Jan Kara <jack@suse.cz>,
	John Garry <john.g.garry@oracle.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH] iomap: Fix broken data integrity guarantees for O_SYNC writes
Date: Thu, 31 Jul 2025 14:35:10 +0530	[thread overview]
Message-ID: <871ppwspbt.fsf@gmail.com> (raw)
In-Reply-To: <20250730102840.20470-2-jack@suse.cz>

Jan Kara <jack@suse.cz> writes:

> Commit d279c80e0bac ("iomap: inline iomap_dio_bio_opflags()") has broken
> the logic in iomap_dio_bio_iter() in a way that when the device does
> support FUA (or has no writeback cache) and the direct IO happens to
> freshly allocated or unwritten extents, we will *not* issue fsync after
> completing direct IO O_SYNC / O_DSYNC write because the
> IOMAP_DIO_WRITE_THROUGH flag stays mistakenly set. Fix the problem by
> clearing IOMAP_DIO_WRITE_THROUGH whenever we do not perform FUA write as
> it was originally intended.
>
> CC: John Garry <john.g.garry@oracle.com>
> CC: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com>
> Fixes: d279c80e0bac ("iomap: inline iomap_dio_bio_opflags()")
> CC: stable@vger.kernel.org
> Signed-off-by: Jan Kara <jack@suse.cz>


Nice catch. It's been there since v6.15 I guess. Looks like it didn't
get caught in xfstests either then. 

We have generic/737, but looks like it only covers O_SYNC dio writes. Let
me enhance that to cover O_DYSNC dio writes too.

Looks good to me. Please feel free to add:

Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>

-ritesh

  parent reply	other threads:[~2025-07-31  9:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-30 10:28 [PATCH] iomap: Fix broken data integrity guarantees for O_SYNC writes Jan Kara
2025-07-30 14:04 ` Christoph Hellwig
2025-07-30 15:08 ` Darrick J. Wong
2025-07-30 16:30 ` John Garry
2025-07-31  9:05 ` Ritesh Harjani [this message]
2025-07-31 11:24 ` Christian Brauner

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=871ppwspbt.fsf@gmail.com \
    --to=ritesh.list@gmail.com \
    --cc=brauner@kernel.org \
    --cc=djwong@kernel.org \
    --cc=jack@suse.cz \
    --cc=john.g.garry@oracle.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --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