common/fuzzy: try to clear blocking flags first in _scratch_fuzz_modify
[xfstests-dev.git] / tests / generic / 312
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2013 Red Hat, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 312
6 #
7 # ENOSPC in fallocate(2) could corrupt ext4 when file size > 4G
8 #
9 # Regression test for commit
10 # 29ae07b ext4: Fix overflow caused by missing cast in ext4_fallocate()
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 _supported_os Linux
34 _require_xfs_io_command "falloc"
35 _require_scratch
36
37 # 5G in byte
38 fssize=$((2**30 * 5))
39
40 rm -f $seqres.full
41 _scratch_mkfs_sized $fssize >>$seqres.full 2>&1
42 _scratch_mount >>$seqres.full 2>&1
43
44 echo "Silence is golden"
45
46 # fallocate(2) a 6G(> 4G) file on a 5G fs
47 $XFS_IO_PROG -f -c "falloc 0 6g" $SCRATCH_MNT/testfile.$seq >>$seqres.full 2>&1
48
49 _scratch_unmount
50 status=0
51 exit