Re: [RFC PATCH v2 0/5] Add buffered write-through support to iomap & xfs
From: Ojaswin Mujoo
Date: Mon Jun 01 2026 - 12:56:57 EST
On Wed, May 13, 2026 at 11:14:21AM +0530, Ojaswin Mujoo wrote:
> On Mon, May 04, 2026 at 09:54:49AM +0200, Daniel Gomez wrote:
> > On 08/04/2026 20.45, Ojaswin Mujoo wrote:
> > > Hi all,
> > >
> > > This is the v2 RFC to add buffered writethrough support to iomap and
> > > xfs. The changes made are mostly to get the writethrough implementation
> > > more inline with how dio handles writes.
> > >
> > >
> >
> > I gave these series a run with kdevops and fstests using the following
> > profiles: xfs-crc-logdev, xfs-crc, xfs-reflink-logdev, xfs-reflink.
> >
> > Note that I applied all patches on top of v7.1-rc1 and xfstest-dev
> > patches from Ojaswin have been rebased on latest master [1].
> >
> > Link:
> > https://github.com/dagomez137/xfstests-dev/tree/iomap-buf-writethrough2 [1].
> >
> > In general, some of the results here seem flaky. But let me know what
> > you think. I'll try to confirm the possible regressions with another
> > full run.
> >
> >
> > Summary per profile:
> >
> > * xfs-crc-logdev: no regressions or fixes found
> > * xfs-crc:
> > * generic/753 fixed. This test failed on 7.1.0-rc1 run but succeeded
> > on 7.1.0-rc1-00005-gc6a39600d3c3.
> > * xfs-reflink-logdev:
> > * generic/415 failed on 7.1.0-rc1-00005-gc6a39600d3c3. I tried to
> > replicate the issue by just running generic/415 (not the entire test
> > suite), and I couldn't replicate it.
> > * xfs-reflink:
> > * generic/457 failed on 7.1.0-rc1-00005-gc6a39600d3c3.
> > * generic/561 failed on 7.1.0-rc1 but not on
> > 7.1.0-rc1-00005-gc6a39600d3c3.
>
> Hey Daniel,
>
> thanks so much for testing the patches. I'm back this week
> from travel so still catching up to my emails. I'll go trhough thi and
> get back to you soon.
>
> Regards,
> Ojaswin
Hi Daniel,
So this week I spent some time looking into the failure of g/457.
I was able to replicate it in my setup and after analysing it, this is
actually an issue in my xfstests patch. The issue is that to verify
RWF_WRITETHROUGH support I do a 4kb write on the fd during the test prep
phase. However "out-of-band" write makes the actual contents of the file
different from what fsx expected (It reads it in before the problematic
write), causing the test failure.
The below snippet fixes it:
diff --git a/ltp/fsx.c b/ltp/fsx.c
index 720bca83..1c76634b 100644
--- a/ltp/fsx.c
+++ b/ltp/fsx.c
@@ -2077,16 +2077,34 @@ test_dontcache_io(void)
return 1;
}
+/*
+ * Use a temporary file to test RWF_WRITETHROUGH so as to not modify the
+ * original. This is so that fsx expected contents and the actual contents
+ * of the original file don't go out of sync
+ */
int
test_writethrough_io(void)
{
char buf[4096];
+ char tmpname[PATH_MAX];
+ int tmp_fd;
struct iovec iov = { .iov_base = buf, .iov_len = sizeof(buf) };
int ret, e;
+ snprintf(tmpname, sizeof(tmpname), "%s.fsx.XXXXXX", fname);
+
+ tmp_fd = mkstemp(tmpname);
+ if (fd < 0) {
+ perror("test_writethrough_io: mkstemp() failed\n");
+ exit(132);
+ }
+
memset(buf, '\0', sizeof(buf));
- ret = pwritev2(fd, &iov, 1, 0, RWF_WRITETHROUGH);
+ ret = pwritev2(tmp_fd, &iov, 1, 0, RWF_WRITETHROUGH);
e = ret < 0 ? errno : 0;
+
+ close(tmp_fd);
+
if (e == EOPNOTSUPP) {
if (!quiet)
fprintf(stderr,
Im unable to replicate the 415 failure, but this one is strange because it
doesn't involve any writethrough IO. In you previous runs have you seen
this be flaky?
Admittedly, I've not yet started thorough testing since this is in early
RFC and the design is still getting finalized but I appriciate the help
in testing this.
Thanks again,
ojaswin
>
> >
> >
> > Here the full report list for each A/B profile test run:
> >
> >
> > http://htmlpreview.github.io/?https://github.com/dagomez137/kdevops-results-archive-wt/blob/main/workflows/fstests/results/r0001/fstests-report-7.1.0-rc1-vs-7.1.0-rc1-00005-gc6a39600d3c3-r0001-qsu-xfs-crc-logdev.html
> >
> >
> > http://htmlpreview.github.io/?https://github.com/dagomez137/kdevops-results-archive-wt/blob/main/workflows/fstests/results/r0001/fstests-report-7.1.0-rc1-vs-7.1.0-rc1-00005-gc6a39600d3c3-r0001-qsu-xfs-crc.html
> >
> >
> > http://htmlpreview.github.io/?https://github.com/dagomez137/kdevops-results-archive-wt/blob/main/workflows/fstests/results/r0001/fstests-report-7.1.0-rc1-vs-7.1.0-rc1-00005-gc6a39600d3c3-r0001-qsu-xfs-reflink-logdev.html
> >
> >
> > http://htmlpreview.github.io/?https://github.com/dagomez137/kdevops-results-archive-wt/blob/main/workflows/fstests/results/r0001/fstests-report-7.1.0-rc1-vs-7.1.0-rc1-00005-gc6a39600d3c3-r0001-qsu-xfs-reflink.html
> >