Re: [PATCH] block: skip redundant flush for O_DSYNC direct writes

Christoph Hellwig <[email protected]>
Newsgroups org.kernel.vger.linux-block
Message-ID <[email protected]>
On Thu, Aug 13, 2026 at 03:35:13PM +0800, 马振先 wrote:
> > But looking at this, the original logic here actually is very fishy.
> > If we have a driver that does not actually support FUA, emulating it
> > for every write command is a bad idea.  So this should be fixed to
> > only do FUA when actually useful, and then return from the non-fallback
> > implementations if that actually happened.
> 
> Let me make sure:
>      blkdev_write_iter() then only skips generic_write_sync() when
>      the direct-IO path actually issued REQ_FUA (i.e. iocb_is_dsync(iocb)
>      && bdev_fua(bdev) && the write completed without falling back to
>      buffered).  Is that the direction you had in mind?  If yes, I'll send patch

Yes.  If you want you can probably do this as an incremental patch
on top of the new version of this patch.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.