overlay: run unionmount testsuite test cases
[xfstests-dev.git] / tests / generic / 596
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright 2020 Google LLC
4 #
5 # FS QA Test No. 596
6 #
7 # Regression test for the bug fixed by commit 10a98cb16d80 ("xfs: clear
8 # PF_MEMALLOC before exiting xfsaild thread").  If the bug exists, a kernel
9 # WARNING should be triggered.  See the commit message for details.
10 #
11 seq=`basename $0`
12 seqres=$RESULT_DIR/$seq
13 echo "QA output created by $seq"
14
15 here=`pwd`
16 tmp=/tmp/$$
17 status=1        # failure is the default!
18 trap "_cleanup; exit \$status" 0 1 2 3 15
19
20 _cleanup()
21 {
22         $ACCTON_PROG off >> $seqres.full
23         rm -f $tmp.*
24 }
25
26 # get standard environment, filters and checks
27 . ./common/rc
28 . ./common/filter
29
30 # remove previous $seqres.full before test
31 rm -f $seqres.full
32
33 # real QA test starts here
34 _supported_fs generic
35 _supported_os Linux
36 _require_bsd_process_accounting
37 _require_chattr S
38 _require_test
39 _require_scratch
40
41 # To trigger the bug we must unmount a filesystem while BSD process accounting
42 # is enabled.  The accounting file must also be located on a different
43 # filesystem and have the sync flag set.
44
45 accounting_file=$TEST_DIR/$seq
46
47 rm -f $accounting_file
48 touch $accounting_file
49 $CHATTR_PROG +S $accounting_file
50
51 _scratch_mkfs &>> $seqres.full
52 $ACCTON_PROG $accounting_file >> $seqres.full
53 _scratch_mount
54 _scratch_unmount
55 $ACCTON_PROG off >> $seqres.full
56
57 echo "Silence is golden"
58
59 status=0
60 exit