All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] generic/299: various fixes
@ 2014-12-11 10:49 Eryu Guan
  2014-12-11 10:58 ` [PATCH v2] " Eryu Guan
  0 siblings, 1 reply; 9+ messages in thread
From: Eryu Guan @ 2014-12-11 10:49 UTC (permalink / raw)
  To: fstests; +Cc: Eryu Guan

Fix three problems in generic/299

1. Use $XFS_IO_PROG instead of fallocate/truncate, old distros like
RHEL5 don't have these commands.

2. Remove $seqres.full before test, otherwise the file is growing all
the time.

3. Make sure fio really exits, otherwise fio would block umount. $pid is
the pid of function run_check not fio, sometimes fio is still there when
$pid is dead and blocking umount.

Signed-off-by: Eryu Guan <eguan@redhat.com>
---
 tests/generic/299 | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tests/generic/299 b/tests/generic/299
index e8685a4..ae1bf74 100755
--- a/tests/generic/299
+++ b/tests/generic/299
@@ -125,20 +125,23 @@ _workout()
 	do
 	    for ((k=1; k <= NUM_JOBS; k++))
 	    do
-		fallocate -l $FILE_SIZE $SCRATCH_MNT/direct_aio.$k.0 \
+		$XFS_IO_PROG -f -c "falloc 0 $FILE_SIZE" $SCRATCH_MNT/direct_aio.$k.0 \
 			>> $seqres.full 2>&1
 	    done
 	    for ((k=1; k <= NUM_JOBS; k++))
 	    do
-		truncate -s 0 $SCRATCH_MNT/direct_aio.$k.0 >> $seqres.full 2>&1
+		$XFS_IO_PROG -f -c "truncate 0" $SCRATCH_MNT/direct_aio.$k.0 \
+			>>$seqres.full 2>&1
 	    done
 	    # Following like will check that pid is still run.
 	    # Once fio exit we can stop fallocate/truncate loop
-	    kill -0 $pid > /dev/null 2>&1 || break
+	    pgrep fio >/dev/null 2>&1 || break
 	done
 	wait $pid
 }
 
+rm -f $seqres.full
+
 _scratch_mkfs >> $seqres.full 2>&1
 _scratch_mount
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-12-15  5:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-11 10:49 [PATCH] generic/299: various fixes Eryu Guan
2014-12-11 10:58 ` [PATCH v2] " Eryu Guan
2014-12-11 23:50   ` Dave Chinner
2014-12-12  2:51     ` Eryu Guan
2014-12-12  4:43   ` [PATCH v3] " Eryu Guan
2014-12-14 22:12     ` Theodore Ts'o
2014-12-14 22:17       ` Theodore Ts'o
2014-12-15  3:52         ` Eryu Guan
2014-12-15  5:02     ` [PATCH v4] " Eryu Guan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.