2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (C) 2014 Red Hat Inc. All rights reserved.
5 # FSQA Test No. btrfs/068
7 # Run btrfs subvolume create/mount/umount/delete and remount with
8 # different compress algorithms simultaneously, with fsstress running
12 _begin_fstest auto subvol remount compress
14 # Import common functions.
17 # real QA test starts here
19 # we check scratch dev after each loop
20 _require_scratch_nocheck
21 _require_scratch_dev_pool 4
22 _btrfs_get_profile_configs
27 local subvol_mnt=$TEST_DIR/$seq.mnt
28 local stop_file=$TEST_DIR/$seq.stop.$$
30 echo "Test $mkfs_opts with $with_compress" >>$seqres.full
32 _scratch_pool_mkfs $mkfs_opts >>$seqres.full 2>&1
33 # make sure we created btrfs with desired options
35 echo "mkfs $mkfs_opts failed"
38 _scratch_mount >>$seqres.full 2>&1
40 args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir`
41 echo "Run fsstress $args" >>$seqres.full
42 $FSSTRESS_PROG $args >/dev/null 2>&1 &
45 # make sure the stop sign is not there
47 echo -n "Start subvolume worker: " >>$seqres.full
48 _btrfs_stress_subvolume $SCRATCH_DEV $SCRATCH_MNT subvol_$$ $subvol_mnt $stop_file >/dev/null 2>&1 &
50 echo "$subvol_pid" >>$seqres.full
52 echo -n "Start remount worker: " >>$seqres.full
53 _btrfs_stress_remount_compress $SCRATCH_MNT >/dev/null 2>&1 &
55 echo "$remount_pid" >>$seqres.full
57 echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full
63 # wait for the remount loop process to finish
64 while ps aux | grep "mount.*$SCRATCH_MNT" | grep -qv grep; do
68 echo "Scrub the filesystem" >>$seqres.full
69 $BTRFS_UTIL_PROG scrub start -B $SCRATCH_MNT >>$seqres.full 2>&1
71 echo "Scrub find errors in \"$mkfs_opts\" test" | tee -a $seqres.full
74 # in case the subvolume is still mounted
75 $UMOUNT_PROG $subvol_mnt >/dev/null 2>&1
77 # we called _require_scratch_nocheck instead of _require_scratch
78 # do check after test for each profile config
82 echo "Silence is golden"
83 for t in "${_btrfs_profile_configs[@]}"; do