generic: test MADV_POPULATE_READ with IO errors
[xfstests-dev.git] / tests / ext4 / 038
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2016 Fujitsu.  All Rights Reserved.
4 #
5 # FS QA Test ext4/038
6 #
7 # Regression test for commit:
8 # c9eb13a ext4: fix hang when processing corrupted orphaned inode list
9 #
10 . ./common/preamble
11 _begin_fstest auto quick
12
13 # Import common functions.
14
15 # real QA test starts here
16 _supported_fs ext3 ext4
17 _require_scratch
18 _require_command "$DEBUGFS_PROG" debugfs
19
20 echo "Silence is golden"
21
22 # Although the bug only happens when last_orphan is set to 5
23 # it is better to test all reserved inode numbers 1-10 here
24 for i in {1..10}; do
25         # create smaller filesystems to save test time
26         _scratch_mkfs_sized $((16 * 1024 * 1024)) >>$seqres.full 2>&1
27         $DEBUGFS_PROG -w -R "ssv last_orphan $i" $SCRATCH_DEV >>$seqres.full 2>&1
28         _scratch_mount
29         _scratch_unmount
30 done
31
32 # success, all done
33 status=0
34 exit