common: kill _supported_os
[xfstests-dev.git] / tests / generic / 491
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (C) 2018 CTERA Networks. All Rights Reserved.
4 #
5 # FS QA Test No. 491
6 #
7 # Test first read with freeze right after mount.
8 #
9 # With ext4, this leads to freeze proection bypass WARN_ON in
10 # ext4_journal_check_start.
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 generic
33 _require_scratch
34 _require_freeze
35 _require_command "$TIMEOUT_PROG" "timeout"
36
37 rm -f $seqres.full
38
39 testfile=$SCRATCH_MNT/foo
40
41 # Create a filesystem with a file
42 _scratch_mkfs >>$seqres.full 2>&1
43 _scratch_mount
44 echo "frozen" > $testfile
45
46 # Mount filesystem "noatime" and freeze right after mount -
47 # reads should not block
48 _scratch_cycle_mount "noatime"
49 xfs_freeze -f $SCRATCH_MNT
50
51 # Read file while filesystem is frozen should succeed
52 # without blocking
53 $TIMEOUT_PROG -s KILL 1s cat $testfile
54
55 xfs_freeze -u $SCRATCH_MNT
56
57 status=0
58 exit