Re: [RFC PATCH] btrfs/066: Fix race condition by making 'subvolume stress' task to exit gracefully

Chandan Rajendra
2016-03-17T09:44:00Z

On Thursday 17 Mar 2016 15:23:39 Eryu Guan wrote:
> A named pipe seems too heavy and complicated to me. How about breaking
> out the loop in _btrfs_stress_subvolume on the existence of some file?
> e.g.
>
> _btrfs_stress_subvolume():
> ...
> local stop_file=$5
> while [ ! -e $stop_file ]; do
> ...
> done
>
> run_test():
> ...
> local stop_file=$TEST_DIR/$seq.stop.$$
> ...
> # make sure the stop sign is not there
> rm -f $stop_file
> _btrfs_stress_subvolume $SCRATCH_DEV $SCRATCH_MNT subvol_$$
$subvol_mnt
> $stop_file & ...
> wait $fsstress_pid
> touch $stop_file
> kill $scrub_pid
> wait
>

Yes, you are right. This above method is much simpler. I will send out a patch
with the new fix.

--
chandan