generic/322: fix bad xfs_io sync_range command
authorAndreas Gruenbacher <agruenba@redhat.com>
Mon, 19 Aug 2019 08:57:36 +0000 (10:57 +0200)
committerEryu Guan <guaneryu@gmail.com>
Sat, 24 Aug 2019 14:05:49 +0000 (22:05 +0800)
Add the missing range arguments to the sync_range command in this test:
according to Josef Bacik, the sync_range command is required to make the test
reproduce the critical situation reliably.

[Eryu: fix dumping xfs_io output to $seqres.full, don't check
xfs_io's exit status]

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Suggested-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/generic/322

index 2afd7127fd616e53a9de8badc23b96536b8df603..0b5249b1813ecb06a80a900dcd2b861e343bc091 100755 (executable)
@@ -45,7 +45,7 @@ _rename_test()
        echo "fsync rename test"
        _mount_flakey
        $XFS_IO_PROG -f -c "pwrite 0 1M" -c "fsync" $SCRATCH_MNT/foo \
-               > $seqres.full 2>&1 || _fail "xfs_io failed"
+               >> $seqres.full 2>&1
        mv $SCRATCH_MNT/foo $SCRATCH_MNT/bar
        $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/bar
        md5sum $SCRATCH_MNT/bar | _filter_scratch
@@ -65,7 +65,7 @@ _write_after_fsync_rename_test()
        echo "fsync rename test"
        _mount_flakey
        $XFS_IO_PROG -f -c "pwrite 0 1M" -c "fsync" -c "pwrite 2M 1M" \
-               -c "sync_range -b" $SCRATCH_MNT/foo > $seqres.full 2>&1 || _fail "xfs_io failed"
+               -c "sync_range -b 2M 1M" $SCRATCH_MNT/foo >> $seqres.full 2>&1
        mv $SCRATCH_MNT/foo $SCRATCH_MNT/bar
        $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/bar
        md5sum $SCRATCH_MNT/bar | _filter_scratch