generic/590: fix the xfs feature detection logic
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 23 Apr 2020 23:31:18 +0000 (16:31 -0700)
committerEryu Guan <guaneryu@gmail.com>
Sun, 10 May 2020 15:04:37 +0000 (23:04 +0800)
commit0f58b106e2a57f34ff6bf6fa9f9b06fc1888b1d8
tree4064148140e26fb0b2656a3eed25e97dab1e1852
parent10aa5e2904d240cd8b82453700d8d78860b60478
generic/590: fix the xfs feature detection logic

The setup code in this regression test case tries to figure out if
certain features known to be incompatible with realtime are known to
mkfs, and if so, to forcibly disable them.

Unfortunately, the reflink feature detection logic here is broken,
because we have no way of distinguishing between the helper function
_scratch_mkfs_xfs_supported returning nonzero because reflink isn't
compatible with mkfs's defaults (e.g. your mkfs has rmapbt=1 by default)
vs. reflink isn't recognized at all vs. something else broke.

However, we can grep the mkfs output to look for reflink support, and if
we find it then we disable it.  That's fine for this test, since on XFS
it's trying to set up the exact conditions to test a known bug.

Second, rmapbt isn't currently compatible with realtime either, so we
need to detect and mask that off too.

Third, the test only needs to perform this feature detection if the test
runner didn't set SCRATCH_RTDEV, because we require that if the runner
configured SCRATCH_RTDEV, they also set MKFS_OPTIONS appropriately.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/generic/590