Re: [PATCH v4 6/8] block: don't fall back to buffered I/O for atomic writes

From: Tal Zussman

Date: Wed Sep 23 2026 - 19:39:19 EST


On 9/22/26 6:05 AM, John Garry wrote:
> On 9/22/26 03:54, Tal Zussman wrote:
>
> Note that I still think that you can add an IOCB_ATOMIC check in
> iomap_file_buffered_write() (until it does handle IOCB_ATOMIC).
>

Will do!

> Reviewed-by: John Garry <john.garry@xxxxxxxxx>
>

Thanks!

>> ---
>> block/fops.c | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/block/fops.c b/block/fops.c
>> index 90777e8a9a6c..7f23778f6b81 100644
>> --- a/block/fops.c
>> +++ b/block/fops.c
>> @@ -766,10 +766,11 @@ static ssize_t blkdev_write_iter(struct kiocb *iocb, struct iov_iter *from)
>> if (iocb->ki_flags & IOCB_DIRECT) {
>> ret = blkdev_direct_write(iocb, from);
>> if (ret >= 0 && iov_iter_count(from)) {
>> - if (iocb->ki_flags & IOCB_NOWAIT) {
>> + if (iocb->ki_flags & (IOCB_NOWAIT | IOCB_ATOMIC)) {
>> /*
>> * The buffered fallback blocks on i_rwsem and
>> - * on writeback of the data it copied: return
>> + * on writeback of the data it copied, and
>> + * can't provide torn-write protection: return
>> * the short direct write instead and let the
>> * caller retry.
>> */
>>
>