Re: [RFC PATCH v4 08/12] iomap: Add DSYNC support to RWF_WRITETHROUGH
From: Ojaswin Mujoo
Date: Tue Sep 29 2026 - 10:04:45 EST
On Mon, Sep 28, 2026 at 05:33:09PM +0530, Ojaswin Mujoo wrote:
> Add DSYNC support to writethrough buffered writes. Unlike the usual
> buffered writes where we call generic_write_sync() inline during the
> syscall path, for writethrough we instead sync the data during IO
> completion path, just like dio.
>
> This allows aio writethrough to be truly async where the syscall can
> return after IO submission and the sync can then be done asynchronously
> during IO completion time.
>
> Further, just like dio, we utilize the FUA optimization, if available,
> to avoid syncing the data for DSYNC operations.
>
> Suggested-by: Dave Chinner <dgc@xxxxxxxxxx>
> Co-developed-by: Ritesh Harjani (IBM) <ritesh.list@xxxxxxxxx>
> Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@xxxxxxxxx>
> Signed-off-by: Ojaswin Mujoo <ojaswin@xxxxxxxxxxxxx>
I made a small mistake here while doing the final squash. This patch
also removes the EOPNOTSUPP on dsync in iomap_file_writethrough_iter();
@@ -1798,9 +1824,6 @@ ssize_t iomap_file_writethrough_write(struct kiocb *iocb, struct iov_iter *i,
return -EINVAL;
if (iocb->ki_flags & (IOCB_DONTCACHE))
return -EINVAL;
- if (iocb_is_dsync(iocb))
- /* D_SYNC support not implemented yet */
- return -EOPNOTSUPP;
if (iocb->ki_flags & IOCB_NOWAIT)
Regards,
ojaswin