xfstests: btrfs/276 - stop all fsstress before exiting
PATCH 1/1 xfstests: btrfs/276 - stop all fsstress before exiting
Tests after 276 were failing because the background fsstress hadn't quit prior to exit, devices couldn't be unmounted, etc.
Just use the same trick as generic/068 does, and use a tmpfile to control whether the background loop keeps running.
Also, no need to umount scratch at cleanup time, the scripts do that for us.
---
(nobody else ran into this? really?)
tests/btrfs/276 +5 -9
@@ -36,14 +36,8 @@ noise_pid=0 _cleanup() { - if [ $noise_pid -ne 0 ]; then - echo "background noise kill $noise_pid" >>$seqres.full - kill $noise_pid - noise_pid=0 - wait - fi - echo "*** unmount" - umount $SCRATCH_MNT 2>/dev/null + rm $tmp.running + wait rm -f $tmp.* } trap "_cleanup; exit \$status" 0 1 2 3 15
@@ -210,7 +204,7 @@ workout() if [ $do_bg_noise -ne 0 ]; then # make background noise while backrefs are being walked - while /bin/true; do + while [ -f "$tmp.running" ]; do echo background fsstress >>$seqres.full run_check $FSSTRESS_PROG -d $SCRATCH_MNT/bgnoise -n 999 echo background rm >>$seqres.full
@@ -263,6 +257,8 @@ nfiles=4 numprocs=1 do_bg_noise=1 +touch $tmp.running + workout $filesize $nfiles $numprocs $snap_name $do_bg_noise echo "*** done"
tests/btrfs/276.out +0 -1
@@ -1,4 +1,3 @@ QA output created by 276 *** test backref walking *** done -*** unmount
Quoted 2 lines · Eric Sandeen
Tests after 276 were failing because the background fsstress hadn't quit prior to exit, devices couldn't be unmounted, etc.
I don't see how that would happen. Any further insight?
Quoted 3 lines
Just use the same trick as generic/068 does, and use a tmpfile to control whether the background loop keeps running.
I like that trick :-)
Thanks,
-Jan
Quoted 62 lines
Also, no need to umount scratch at cleanup time, the scripts do that for us.
Signed-off-by Eric Sandeen <[email protected]>---
(nobody else ran into this? really?)
tests/btrfs/276 +5
-9@@ -36,14 +36,8 @@ noise_pid=0 _cleanup() { - if [ $noise_pid -ne 0 ]; then - echo "background noise kill $noise_pid" >>$seqres.full - kill $noise_pid - noise_pid=0 - wait - fi - echo "*** unmount" - umount $SCRATCH_MNT 2>/dev/null + rm $tmp.running + wait rm -f $tmp.* } trap "_cleanup; exit \$status" 0 1 2 3 15@@ -210,7 +204,7 @@ workout() if [ $do_bg_noise -ne 0 ]; then # make background noise while backrefs are being walked - while /bin/true; do + while [ -f "$tmp.running" ]; do echo background fsstress >>$seqres.full run_check $FSSTRESS_PROG -d $SCRATCH_MNT/bgnoise -n 999 echo background rm >>$seqres.full@@ -263,6 +257,8 @@ nfiles=4 numprocs=1 do_bg_noise=1 +touch $tmp.running + workout $filesize $nfiles $numprocs $snap_name $do_bg_noise echo "*** done"tests/btrfs/276.out +0
-2@@ -1,4 +1,3 @@ QA output created by 276 *** test backref walking *** done -*** unmount --To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 6 lines · Jan Schmidt
Quoted 2 lines · Eric Sandeen
Tests after 276 were failing because the background fsstress hadn't quit prior to exit, devices couldn't be unmounted, etc.
I don't see how that would happen. Any further insight?
Yes, sorry for not including it. The parent process was killed, but the fsstress processes just got reparented to init.
I tried for a while to use pkill to knock them of first but this seems simpler, actually.
Eric
Quoted 71 lines
Quoted 3 lines
Just use the same trick as generic/068 does, and use a tmpfile to control whether the background loop keeps running.
I like that trick :-)
Thanks,
-JanQuoted 62 lines
Also, no need to umount scratch at cleanup time, the scripts do that for us.
Signed-off-by Eric Sandeen <[email protected]>---
(nobody else ran into this? really?)
tests/btrfs/276 +2
-8@@ -36,14 +36,8 @@ noise_pid=0 _cleanup() { - if [ $noise_pid -ne 0 ]; then - echo "background noise kill $noise_pid" >>$seqres.full - kill $noise_pid - noise_pid=0 - wait - fi - echo "*** unmount" - umount $SCRATCH_MNT 2>/dev/null + rm $tmp.running + wait rm -f $tmp.* }trap "
_cleanup; exit \$status" 0 1 2 3 15tests/btrfs/276 +1
-1@@ -210,7 +204,7 @@ workout() if [ $do_bg_noise -ne 0 ]; then # make background noise while backrefs are being walked - while /bin/true; do + while [ -f "$tmp.running" ]; do echo background fsstress >>$seqres.full run_check $FSSTRESS_PROG -d $SCRATCH_MNT/bgnoise -n 999 echo background rm >>$seqres.full@@ -263,6 +257,8 @@ nfiles=4numprocs=1
do_bg_noise=1tests/btrfs/276 +2
-0+touch $tmp.running +workout $filesize $nfiles $numprocs $snap_name $do_bg_noise
echo "*** done"
tests/btrfs/276.out +0
-0@@ -1,4 +1,3 @@QA output created by 276
*** test backref walking
*** done
-*** unmount--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 6 lines · Eric Sandeen
Quoted 4 lines · Jan Schmidt
Quoted 2 lines · Eric Sandeen
Tests after 276 were failing because the background fsstress hadn't quit prior to exit, devices couldn't be unmounted, etc.
Quoted 8 lines
Quoted 2 lines
I don't see how that would happen. Any further insight?
Yes, sorry for not including it. The parent process was killed, but the fsstress processes just got reparented to init.
I tried for a while to use pkill to knock them of first but this seems simpler, actually.
Eric
Jan, with Eric's explanation, may I put your Reviewed-by: on this patch?
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 12 lines · Rich Johnston
Quoted 11 lines · Eric Sandeen
Quoted 6 lines · Jan Schmidt
Quoted 2 lines · Eric Sandeen
Tests after 276 were failing because the background fsstress hadn't quit prior to exit, devices couldn't be unmounted, etc.
I don't see how that would happen. Any further insight?
Yes, sorry for not including it. The parent process was killed, but the fsstress processes just got reparented to init.
Quoted 7 lines
Quoted 5 lines
I tried for a while to use pkill to knock them of first but this seems simpler, actually.
Eric
Jan, with Eric's explanation, may I put your Reviewed-by: on this patch?
Yes, you may :-)
-Jan
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Thanks for the patch Eric and the review Jan, this has been committed.
--Rich
commit 0b5677123b5d8c0a29b45f55c7b981aeeca9b2c8
Author: Eric Sandeen <[email protected]> Date: Fri Apr 26 05:29:21 2013 +0000
xfstests: btrfs/276 - stop all fsstress before exiting