generic: test MADV_POPULATE_READ with IO errors
[xfstests-dev.git] / tests / xfs / 020
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2014 Red Hat Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. xfs/020
6 #
7 # Test segfault issue when repairing large xfs.
8 #
9 # Regression test for xfsprogs commit
10 # 7f2d6b8 xfs_repair: avoid segfault if reporting progress early in repair
11 #
12 . ./common/preamble
13 _begin_fstest auto repair
14
15 # Override the default cleanup function.
16 _cleanup()
17 {
18     cd /
19     rm -f $tmp.*
20     rm -f $fsfile
21 }
22
23 # Import common functions.
24 . ./common/filter
25
26 # real QA test starts here
27 _supported_fs xfs
28 _require_test
29
30 # Writing a 60t fs requires about 2GB of space, so make sure
31 # we have plenty of space to do that.
32 _require_fs_space $TEST_DIR 2500000
33
34 echo "Silence is golden"
35
36 fsfile=$TEST_DIR/fsfile.$seq
37 rm -f $fsfile
38 # The actual truncate command is required here (and not xfs_io) because it
39 # returns nonzero if the operation fails.
40 truncate -s 60t $fsfile || _notrun "Cannot create 60T sparse file for test."
41 rm -f $fsfile
42
43 $MKFS_PROG -t xfs -d size=60t,file,name=$fsfile >/dev/null
44 $XFS_REPAIR_PROG -f -o ag_stride=32 -t 1 $fsfile >/dev/null 2>&1
45
46 status=$?
47 exit