On Sat, Jan 23, 2021 at 07:41:39AM +0100, Christoph Hellwig wrote:
quoted
In fact, I wonder if we need to do anything other than just use
REQ_FUA unconditionally in iomap for this situation, as the block
layer will translate REQ_FUA to a write+post-flush if the device
doesn't support FUA writes directly.
You're thoughts on that, Christoph?
For the pure overwrite O_DIRECT + O_DSYNC case we'd get away with just
a flush. And using REQ_FUA will get us there, so it might be worth
a try.
And looking at this a little more, while just using REQ_FUA would
work it would be rather suboptimal for many cases, as the block layer
flush state machine would do a flush for every bio. So for each
O_DIRECT + O_DSYNC write that generates more than one bio we'd grow
extra flushes.