xfs: force file creation to the data device for certain layout tests
[xfstests-dev.git] / tests / ext4 / 037
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2015 Red Hat Inc.  All Rights Reserved.
4 #
5 # FS QA Test ext4/037
6 #
7 # Test mount a needs_recovery partition with noload option.
8 # ext4 used to Oops until part of this commit:
9 #
10 # 744692d ext4: use ext4_get_block_write in buffer write
11 #
12 seq=`basename $0`
13 seqres=$RESULT_DIR/$seq
14 echo "QA output created by $seq"
15
16 here=`pwd`
17 tmp=/tmp/$$
18 status=1        # failure is the default!
19 trap "_cleanup; exit \$status" 0 1 2 3 15
20
21 _cleanup()
22 {
23         cd /
24         rm -f $tmp.*
25 }
26
27 # get standard environment, filters and checks
28 . ./common/rc
29 . ./common/filter
30
31 # real QA test starts here
32 _supported_fs ext3 ext4
33
34 # nofsck as we modify sb via debugfs
35 _require_scratch_nocheck
36
37 # remove previous $seqres.full before test
38 rm -f $seqres.full
39 echo "Silence is golden"
40
41 _scratch_mkfs >>$seqres.full 2>&1
42
43 # set needs_recovery feature bit
44 debugfs -w -R "feature +needs_recovery" $SCRATCH_DEV \
45         >>$seqres.full 2>&1
46
47 # mount with noload option
48 _try_scratch_mount "-o noload" >>$seqres.full 2>&1
49
50 # success, all done
51 status=0
52 exit