Re: [PATCH v2 3/3] exfat: drain in-flight DIO before buffered write fallback

From: jiale yao

Date: Mon Sep 28 2026 - 05:12:26 EST


Hi Zhiling,

At 2026-09-27 21:04:58, "Chi Zhiling" <chizhiling@xxxxxxx> wrote:
>On 9/26/26 3:26 PM, Jiale Yao wrote:
>> diff --git a/fs/exfat/file.c b/fs/exfat/file.c
>> index a2a9ee1a2004..cf5ccbd54823 100644
>> --- a/fs/exfat/file.c
>> +++ b/fs/exfat/file.c
>> @@ -807,6 +807,12 @@ static ssize_t exfat_fallback_buffered_write(struct kiocb *iocb,
>>
>> iocb->ki_flags &= ~IOCB_DIRECT;
>>
>> + /*
>> + * Prevent concurrent direct I/O and buffered I/O to the same file
>> + * range. Wait for in-flight DIO to finish before dirtying pages.
>> + */
>> + inode_dio_wait(file_inode(iocb->ki_filp));
>
>This change is correct, but the comment is not accurate because the
>function you modified is not part of the buffered I/O path in exFAT.
>
>You can add inode_dio_wait() to both exfat_file_write_iter() and
>exfat_fallback_buffered_write(), and move the comment to
>exfat_file_write_iter().
>
>> +
>> written = iomap_file_buffered_write(iocb, from, &exfat_write_iomap_ops,
>> NULL, NULL);
>> if (written < 0)

Thanks for your review. See v3 in:
https://lore.kernel.org/all/20260928085412.2221055-1-yaojiale02@xxxxxxx/