xfs/077: fix test for userspace meta_uuid support
authorEric Sandeen <sandeen@sandeen.net>
Mon, 21 Sep 2015 03:06:18 +0000 (13:06 +1000)
committerDave Chinner <david@fromorbit.com>
Mon, 21 Sep 2015 03:06:18 +0000 (13:06 +1000)
The current _require_meta_uuid() test looks for a failure return
code from xfs_db -x -c "uuid generate" but in fact this exits
with success.  (In fact uuid_f always exits with success; perhaps
this needs fixing, but that's in the wild now).

So grep for the string(s) stating that it failed, instead.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
common/rc

index 64732f1d3c1293be8596e4e7e153e85f882c9c44..0049f6ecf5174690798c130941640f1258e87960 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -2747,8 +2747,11 @@ _require_meta_uuid()
        # This will create a crc fs on $SCRATCH_DEV
        _require_xfs_crc
 
-       $XFS_DB_PROG -x -c "uuid generate" $SCRATCH_DEV >/dev/null 2>&1 \
-          || _notrun "Userspace doesn't support meta_uuid feature"
+       $XFS_DB_PROG -x -c "uuid restore" $SCRATCH_DEV 2>&1 \
+          | grep -q "invalid UUID\|supported on V5 fs" \
+          && _notrun "Userspace doesn't support meta_uuid feature"
+
+       $XFS_DB_PROG -x -c "uuid generate" $SCRATCH_DEV >/dev/null 2>&1
 
        _scratch_mount >/dev/null 2>&1 \
           || _notrun "Kernel doesn't support meta_uuid feature"