Re: [PATCH] xfs/259: handle minimum block size more precisely

Dave Chinner
2016-04-12T21:01:07Z

On Mon, Apr 11, 2016 at 07:38:11PM +0800, Eryu Guan wrote:
> On Mon, Apr 11, 2016 at 10:02:38AM +1000, Dave Chinner wrote:
> > Which is not at all clear from the patch description.
> >
> > Seriously, though, this does not belong in common/config. We already
> > have a helper function to check what mkfs supports (i.e.
> > _scratch_mkfs_xfs_supported()), and if we just want a bare check
> > then factor this into a _mkfs_xfs_supported() and supply the
> > parameters specific to the test.
> >
> > Indeed, this is basically what we do with _require_xfs_mkfs_crc();
> > the same thing should be done, but without the "notrun" if -m crc
> > s not supported...
>
> Looking into _require_xfs_mkfs_crc() and _scratch_mkfs_xfs_supported(),
> I noticed that they are not the helpers I want. They are testing whether
> mkfs.xfs supports CRC (or other mkfs options), what I want is what's the
> default behavior of mkfs.xfs (CRC enabled or not).

All this, just to avoid testing on an invalid block size when CRCs
are enabled. I really don't see why this needs changes to generic
infrastructure - it's a test specific problem.

How about you simply reverse the block size order that is tested,
and capture the output of the actual mkfs command that is being
tested, and determine if 512 byte block sizes should be tested
based on that output? i.e.

for b in 4096 2038 1024 512; do
if [ $b -eq 512 -a $_fs_has_crcs -ne 1 ]; then
break;
fi
....
mkfs -b $b ....
. $tmp.mkfs
done

Cheers,

Dave.
--
Dave Chinner
david@fromorbit.com