#!/bin/bash
-# FS QA Test No. btrfs/036
-#
-# Regression test for running snapshots and send concurrently.
-#
-#-----------------------------------------------------------------------
+# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2014 Fujitsu. All Rights Reserved.
#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+# FS QA Test No. btrfs/036
#
-#-----------------------------------------------------------------------
+# Regression test for running snapshots and send concurrently.
#
-
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
# kill backgroud snapshots
if [ $snapshots_pid -ne 0 ] && ps -p $snapshots_pid | grep -q $snapshots_pid; then
kill -TERM $snapshots_pid 2> /dev/null
+ wait $snapshots_pid
fi
rm -f $tmp.*
}
do_snapshots()
{
+ # Wait for any running 'btrfs subvolume snapshot' subcommand before
+ # exitting so that after the test kills the subshell running this
+ # function, it does not fail with EBUSY when unmounting the scratch
+ # device.
+ trap "wait; exit" SIGTERM
+
i=2
while [ 1 ]
do
. ./common/rc
. ./common/filter
+# remove previous $seqres.full before test
+rm -f $seqres.full
+
# real QA test starts here
_supported_fs btrfs
-_supported_os Linux
_require_scratch
_scratch_mkfs > /dev/null 2>&1