generic: test MADV_POPULATE_READ with IO errors
[xfstests-dev.git] / tests / generic / 052
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 052
6 #
7 # To test log replay by shutdown of file system
8 # This is the first simple initial test to ensure that
9 # the goingdown ioctl is working and recovery of
10 # create transactions is working.
11 #
12 . ./common/preamble
13 _begin_fstest shutdown log auto quick
14
15 # Import common functions.
16 . ./common/filter
17 . ./common/log
18
19 # real QA test starts here
20 _supported_fs generic
21
22 rm -f $tmp.log
23
24 _require_scratch
25 _require_scratch_shutdown
26 _require_logstate
27
28 echo "mkfs"
29 _scratch_mkfs >>$seqres.full 2>&1 \
30     || _fail "mkfs scratch failed"
31 _require_metadata_journaling $SCRATCH_DEV
32
33 echo "mount"
34 _scratch_mount
35
36 echo "touch files"
37 touch $SCRATCH_MNT/{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}
38
39 echo "godown"
40 _scratch_shutdown -v -f >> $seqres.full
41
42 echo "unmount"
43 _scratch_unmount
44
45 echo "logprint after going down..."
46 _print_logstate
47
48 # curious if FS consistent at start
49 if false; then
50     if _check_scratch_fs; then
51        echo "*** checked ok ***"
52     fi
53 fi
54
55 echo "mount with replay"
56 _try_scratch_mount $mnt >>$seqres.full 2>&1 \
57     || _fail "mount failed: $mnt $MOUNT_OPTIONS"
58
59 echo "ls SCRATCH_MNT"
60 ls $SCRATCH_MNT | _filter_lostfound
61
62 echo "unmount"
63 _scratch_unmount
64
65 echo "logprint after mount and replay..."
66 _print_logstate
67
68 # success, all done
69 status=0
70 exit