ext4/306: disable 64bit feature too
[xfstests-dev.git] / tests / ext4 / 306
1 #! /bin/bash
2 # FS QA Test No. ext4/306
3 #
4 # Test that blocks are available to non-extent files after a resize2fs
5 # Regression test for commit:
6 # c5c72d8 ext4: fix online resizing for ext3-compat file systems
7 #
8 #-----------------------------------------------------------------------
9 # Copyright (c) 2013 Red Hat, Inc.  All Rights Reserved.
10 #
11 # This program is free software; you can redistribute it and/or
12 # modify it under the terms of the GNU General Public License as
13 # published by the Free Software Foundation.
14 #
15 # This program is distributed in the hope that it would be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 # GNU General Public License for more details.
19 #
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write the Free Software Foundation,
22 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
23 #-----------------------------------------------------------------------
24
25 seq=`basename $0`
26 seqres=$RESULT_DIR/$seq
27 echo "QA output created by $seq"
28
29 PIDS=""
30 status=1        # failure is the default!
31 trap "_cleanup; exit \$status" 0 1 2 3 15
32
33 _cleanup()
34 {
35     _scratch_unmount
36 }
37
38 # get standard environment, filters and checks
39 . ./common/rc
40 . ./common/filter
41
42 # real QA test starts here
43 _supported_fs ext4
44 _supported_os Linux
45
46 _require_scratch
47
48 rm -f $seqres.full
49
50 # Make a small ext4 fs with extents disabled & mount it
51 yes | mkfs.ext4 -O ^extents,^64bit $SCRATCH_DEV 512m >> $seqres.full 2>&1
52 _scratch_mount || _fail "couldn't mount fs"
53
54 # Create a small non-extent-based file
55 echo "Create 1m testfile1"
56 $XFS_IO_PROG -f $SCRATCH_MNT/testfile1 -c "pwrite 0 1m" | _filter_xfs_io
57
58 # Create a large non-extent-based file filling the fs; this will run out & fail
59 echo "Create testfile2 to fill the fs"
60 $XFS_IO_PROG -f $SCRATCH_MNT/testfile2 -c "pwrite 0 512m" | _filter_xfs_io
61 df -h $SCRATCH_MNT >> $seqres.full
62
63 # Grow fs by 512m
64 echo "Resize to 1g"
65 resize2fs $SCRATCH_DEV 1g >> $seqres.full 2>&1 || _fail "Could not resize to 1g"
66 df -h $SCRATCH_MNT >> $seqres.full
67
68 # See if we can add more blocks to the files
69 echo "append 2m to testfile1"
70 $XFS_IO_PROG -f $SCRATCH_MNT/testfile1 -c "pwrite 1m 2m" | _filter_xfs_io
71 echo "append 2m to testfile2"
72 $XFS_IO_PROG -f $SCRATCH_MNT/testfile1 -c "pwrite 512m 2m" | _filter_xfs_io
73
74 status=0
75 exit