btrfs/012: check free size of scratch device before copying files
[xfstests-dev.git] / tests / ext4 / 003
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2014 Fujitsu.  All Rights Reserved.
4 #
5 # FS QA Test No. ext4/003
6 #
7 # Regression test for commit:
8 # b5b6077 ext4: fix wrong assert in ext4_mb_normalize_request()
9 # This testcase checks whether this bug has been fixed.
10 #
11 seq=`basename $0`
12 seqres=$RESULT_DIR/$seq
13 echo "QA output created by $seq"
14
15 trap "_cleanup; exit \$status" 0 1 2 3 15
16
17 _cleanup()
18 {
19     _scratch_unmount
20 }
21
22 # get standard environment, filters and checks
23 . ./common/rc
24 . ./common/filter
25
26 # real QA test starts here
27 _supported_fs ext4
28
29 _require_scratch
30 _require_scratch_ext4_feature "bigalloc"
31
32 rm -f $seqres.full
33
34 $MKFS_EXT4_PROG -F -O bigalloc -C 65536  -g 256 $SCRATCH_DEV 512m \
35         >> $seqres.full 2>&1
36 _scratch_mount
37
38 $XFS_IO_PROG -f -c "pwrite 0 256m -b 1M" $SCRATCH_MNT/testfile 2>&1 | \
39         _filter_xfs_io
40
41 status=0
42 exit