fsx/fsstress: round blocksize properly
[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 _require_bsd_process_accounting
36 _require_chattr S
37 _require_test
38 _require_scratch
39
40 # To trigger the bug we must unmount a filesystem while BSD process accounting
41 # is enabled.  The accounting file must also be located on a different
42 # filesystem and have the sync flag set.
43
44 accounting_file=$TEST_DIR/$seq
45
46 rm -f $accounting_file
47 touch $accounting_file
48 $CHATTR_PROG +S $accounting_file
49
50 _scratch_mkfs &>> $seqres.full
51 $ACCTON_PROG $accounting_file >> $seqres.full
52 _scratch_mount
53 _scratch_unmount
54 $ACCTON_PROG off >> $seqres.full
55
56 echo "Silence is golden"
57
58 status=0
59 exit