Re: [PATCH v2 05/13] generic/1226: Add atomic write test using fio crc check verifier

Ojaswin Mujoo
2025-07-11T18:17:01Z

On Fri, Jul 11, 2025 at 11:51:22AM +0100, John Garry wrote:
> On 11/07/2025 11:39, Ojaswin Mujoo wrote:
> > > I don't think that fio supports such a mode. Or does it?
> > Yes we can achieve it via combination of write job with verify=crc,do_verify=0 followed by
> > verify job with verify=crc,verify_only=1.
>
> So does verify=crc,do_verify=0 really omit the verify and only do write? If
> so, seems good.

Yep, it does the write with verify headers but doesn't do the actual
verification. We can later use a verify_only=1 job to verify it.

I tested this on a setup where i was able to hit crc issues with
max_sectors_kb=4 reliably in 20 iterations with the original approach.
With the above approach we are no longer hitting crc issues.
>
> > I'm testing this right now to
> > see if it can survive max_sectors_kb = 4 (which i think it should since
> > there are no races now). If everything is fine I'll use this approach
> > for the fio tests in the next revision.
>
> understood
>
> > > > Yes, it is a bit less effective but
> > > > then having a data integrity test that can theoretically return false
> > > > positives is not good, it'll always keep me guessing about any failure.
> > > > Having verify at end will not have false failures for sure. Even though
> > > > it comes at a cost of less coverage.
> > > >
> > > > Maybe we can also get some other prespectives on this.
> > > > @Zorro, @Darrick, can you please give your thoughts on this?
> > > >
> > > > As a sidenote, with this issue of fio's verify read splitting, it seems
> > > > like the parallel verify feature in fio itself is flawed for non-atomic
> > > > writes as well since the read can always split and race with the writes.
> > > fio does warn that multiple read and writers in verify mode is unsafe.
> > Right.
> >
> > > > Not sure what the solution is here, maybe time for non splittable atomic
> > > > writes (:p)
> > > I just think that fio in verify mode for ext4 is ok, as long as
> > > max_sectors_kb is large.
> > Yes but i'd rather have the write followed by verify version to avoid
> > false positives in case the read bio does end up splitting for whatever
> > reason.
> >
> > Thanks for catching this issue in the test!
>
> So, if you want to test this way then you need to omit xfs or ensure that
> the bs <= awu max opt for xfs and hope for no problems.

Hmm having parallel verifies would have been surely useful but then
the possibility of false failures would make me lose confidence
in the test. Even with ext4 hardware support, something someday might end
up splitting the read bio. I feel having a write followed by verify
approach is most suitable here.

Regards,
ojaswin

>
> Thanks,
> John
>