Re: [PATCH] generic/366: check minimum dio size correctly

Zorro Lang <[email protected]> Tue, 16 Jun 2026 14:13:50 +0800
Newsgroups org.kernel.vger.fstests
Message-ID <ajDoebRTr8wjaV-Q@zlang-mailbox>
On Tue, Jun 16, 2026 at 07:28:31AM +0200, Christoph Hellwig wrote:
> On Tue, Jun 16, 2026 at 04:13:22AM +0800, Zorro Lang wrote:
> > Oh, if we only need to run it once, how about:
> > 
> > blksz=""
> > for (( i = 0; i < $iterations; i++)); do
> >     ...
> >     if [ -z "$blksz" ];then
> > 	    blksz=`$here/src/min_dio_alignment $SCRATCH_MNT $SCRATCH_DEV`
> >         if [[ $blksz -gt 512 ]]; then
> >             _notrun "512 byte dio alignment required"
> >         fi
> >     fi
> > ...
> 
> I can look into it.  But to me this doesn't really seem worth the
> effort as calling min_dio_alignment is so cheap compared to the
> mount/unmount cycle never mind everything else we do in the loop.

Sure Christoph :) If you feel that's a bit of a time sink, we could also
just add a comment explaining that re-checking the DIO alignment on every
iteration isn't strictly necessary. I'm just concerned that future developers
might mistake it for a hard requirement when modifying this test.

Thanks,
Zorro

>