]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
ext4/305: reduce runtime by limiting mount/umount cycles
authorEryu Guan <eguan@redhat.com>
Mon, 21 Sep 2015 03:06:17 +0000 (13:06 +1000)
committerDave Chinner <david@fromorbit.com>
Mon, 21 Sep 2015 03:06:17 +0000 (13:06 +1000)
ext4/305 sleeps 3 minutes and does mount/umount loop in background,
which produces lots of logs in dmesg and 3 minutes is not necessary.

Ted pointed out that 30 mount/umount cycles is enough to crash a buggy
kernel, so just limit the mount/umount loop to reduce the runtime. And
now the runtime is about 2s.

Reported-by: Theodore Ts'o <tytso@mit.edu>
Suggested-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
tests/ext4/305

index 860d0a6526eda6a6ae6f6f0125505457b3e5ad8b..1711aae8cc7fdfbefc7e954e117884e1a02a3e76 100755 (executable)
@@ -53,19 +53,18 @@ DEV_BASENAME=$(_short_dev $SCRATCH_DEV)
 echo "Start test on device $SCRATCH_DEV, basename $DEV_BASENAME" >$seqres.full
 _scratch_mkfs >>$seqres.full 2>&1
 
-while true;do
-       mount $SCRATCH_DEV $SCRATCH_MNT
-       umount $SCRATCH_DEV
-done &
-PIDS=$!
-
-while true;do
+while true; do
        cat /proc/fs/ext4/$DEV_BASENAME/mb_groups > /dev/null 2>&1
 done &
-PIDS="$PIDS $!"
+PIDS=$!
 
-# sleep for 180s, in most cases a buggy kernel could hit BUG_ON within 3 minutes
-sleep 180
+# 30 loops is enough to crash a buggy kernel
+i=0
+while [ $i -lt 30 ]; do
+       mount $SCRATCH_DEV $SCRATCH_MNT
+       umount $SCRATCH_DEV
+       let i=i+1
+done
 
 # no BUG_ON, all done
 kill $PIDS >/dev/null 2>&1