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

Zorro Lang <[email protected]> Tue, 16 Jun 2026 04:13:22 +0800
Newsgroups org.kernel.vger.fstests
Message-ID <ajBbo5LX-1tk-y3_@zlang-mailbox>
On Mon, Jun 15, 2026 at 03:33:31PM +0200, Christoph Hellwig wrote:
> On Mon, Jun 15, 2026 at 02:58:11AM +0800, Zorro Lang wrote:
> > > +	blksz=`$here/src/min_dio_alignment $SCRATCH_MNT $SCRATCH_DEV`
> > > +	if [[ $blksz -gt 512 ]]; then
> > > +		_notrun "512 byte dio alignment required"
> > > +	fi
> > 
> > Do we need to check this in every iteration?
> 
> We don't, but we also don't want to do an extra mount just to check
> the feature.

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
...


Thanks,
Zorro

> 
>