generic: test MADV_POPULATE_READ with IO errors
[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 . ./common/preamble
13 _begin_fstest auto quick freeze mount
14
15 # Import common functions.
16 . ./common/filter
17
18 # real QA test starts here
19 _supported_fs generic
20 _require_scratch
21 _require_freeze
22 _require_command "$TIMEOUT_PROG" "timeout"
23
24 testfile=$SCRATCH_MNT/foo
25
26 # Create a filesystem with a file
27 _scratch_mkfs >>$seqres.full 2>&1
28 _scratch_mount
29 echo "frozen" > $testfile
30
31 # Mount filesystem "noatime" and freeze right after mount -
32 # reads should not block
33 _scratch_cycle_mount "noatime"
34 xfs_freeze -f $SCRATCH_MNT
35
36 # Read file while filesystem is frozen should succeed
37 # without blocking
38 $TIMEOUT_PROG -s KILL 1s cat $testfile
39
40 xfs_freeze -u $SCRATCH_MNT
41
42 status=0
43 exit