On 2019/9/25 下午5:48, Filipe Manana wrote: [...] >> + >> + # If the system is too fast and the fs is too small, then skip the test >> + if grep -q "No space left" $tmp.filler_result; then >> + ls -alh $SCRATCH_MNT >> $seqres.full >> + cat $tmp.filler_result >> $seqres.full >> + _notrun "system too fast and/or too small fs" > > It would probably be better to require so minimal size for the > filesystem instead. > >> + fi >> + # If killed properly, this file should be empty. > > Confusing comment for me. If killed properly? How does that influence > the file being empty? > What influences the file being empty is that it's impossible (in > practice) for xfs_io to complete the write in less then 2 seconds, > assuming the fs isn't very small and it hits ENOSPC in less than 2 > seconds. The point I want to express is, if xfs_io is killed by KILL signal halfway without finish, it doesn't output anything. So if the output file is not empty (and not ENOSPC), we must have something wrong happened. I'll rephrase that line. Thanks, Qu > > I would rephrase that or remove that line. > > Other than that it looks ok to me. > > Thanks > >> + # If something other than ENOSPC happened, output to make sure we can >> + # detect the error >> + cat $tmp.filler_result >> sync; sync >> } >> >> @@ -147,7 +178,7 @@ btrfs_replace_test() >> if [ "${with_cancel}Q" = "cancelQ" ]; then >> # background the replace operation (no '-B' option given) >> _run_btrfs_util_prog replace start -f $replace_options $source_dev $target_dev $SCRATCH_MNT >> - sleep 1 >> + sleep $wait_time >> _run_btrfs_util_prog replace cancel $SCRATCH_MNT >> >> # 'replace status' waits for the replace operation to finish >> @@ -157,10 +188,10 @@ btrfs_replace_test() >> grep -q canceled $tmp.tmp || _fail "btrfs replace status (canceled) failed" >> else >> if [ "${quick}Q" = "thoroughQ" ]; then >> - # On current hardware, the thorough test runs >> - # more than a second. This is a chance to force >> - # a sync in the middle of the replace operation. >> - (sleep 1; sync) > /dev/null 2>&1 & >> + # The thorough test runs around 2 * $wait_time seconds. >> + # This is a chance to force a sync in the middle of the >> + # replace operation. >> + (sleep $wait_time; sync) > /dev/null 2>&1 & >> fi >> _run_btrfs_util_prog replace start -Bf $replace_options $source_dev $target_dev $SCRATCH_MNT >> >> -- >> 2.22.0 >> > >