xfs/{263,106}: erase max warnings printout
[xfstests-dev.git] / tests / generic / 358
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2016 Oracle, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 358
6 #
7 # Share an extent amongst a bunch of files such that the refcount
8 # stays the same while the rate of change of the set of owners is
9 # steadily increasing.  For example, an extent of 32 blocks is owned
10 # by 32 files.  At block 1, change one of the owners.  At block 2,
11 # change 2 of the owners, and so on.
12 #
13 seq=`basename $0`
14 seqres=$RESULT_DIR/$seq
15 echo "QA output created by $seq"
16
17 here=`pwd`
18 tmp=/tmp/$$
19 status=1        # failure is the default!
20 trap "_cleanup; exit \$status" 0 1 2 3 7 15
21
22 _cleanup()
23 {
24         cd /
25         rm -rf $tmp.*
26         wait
27 }
28
29 # get standard environment, filters and checks
30 . ./common/rc
31 . ./common/filter
32 . ./common/reflink
33
34 # real QA test starts here
35 _supported_os Linux
36 _require_scratch_reflink
37
38 echo "Format and mount"
39 _scratch_mkfs > $seqres.full 2>&1
40 _scratch_mount >> $seqres.full 2>&1
41
42 testdir=$SCRATCH_MNT/test-$seq
43 mkdir $testdir
44
45 blocks=64
46 blksz=65536
47
48 echo "Initialize file"
49 _pwrite_byte 0x61 0 $((blocks * blksz)) $testdir/file >> $seqres.full
50
51 echo "Share the file n-ways"
52 seq 1 $((blocks - 1)) | while read nr; do
53         _reflink_range $testdir/file 0 $testdir/file$nr.0 0 $((nr * blksz)) >> $seqres.full
54         seq $nr $((blocks - 1)) | while read nnr; do
55                 _reflink_range $testdir/file $((nnr * blksz)) $testdir/file$nr.$nnr $((nnr * blksz)) $blksz >> $seqres.full
56         done
57 done
58 _scratch_cycle_mount
59
60 echo "Check output"
61 md5sum $testdir/file $testdir/file*.0 | _filter_scratch
62
63 # success, all done
64 status=0
65 exit