generic: add test for boundary in xfs_attr_shortform_verify
[xfstests-dev.git] / tests / generic / 096
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2015 Red Hat, Inc., Lukas Czerner <lczerner@redhat.com>
4 #
5 # FS QA Test 096
6 #
7 # Exercise the situation that cause ext4 to BUG_ON() when we use
8 # zero range to zero a range which starts within the isize but ends
9 # past the isize but still in the same block. This particular problem
10 # has only been seen on systems with page_size > block_size.
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_scratch
35 _require_xfs_io_command "fzero"
36
37 rm -f $seqres.full
38 echo "Silence is golden"
39
40 # Use smaller scratch fs to shorten the test time
41 _scratch_mkfs_sized $((512 * 1024 * 1024)) >>$seqres.full 2>&1
42 _scratch_mount
43
44 testfile=$SCRATCH_MNT/$seq.$$
45 $XFS_IO_PROG -f -c "pwrite 4096 512" -c "fzero 4351 512" $testfile >> $seqres.full 2>&1
46
47 # success, all done
48 status=0
49 exit