2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2015, Oracle and/or its affiliates. All Rights Reserved.
7 # Try to ENOSPC while expanding the refcntbt by CoWing every block
8 # of a file that eats the whole AG.
11 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
16 status=1 # failure is the default!
17 trap "_cleanup; exit \$status" 0 1 2 3 15
22 rm -rf $tmp.* $testdir
25 # get standard environment, filters and checks
30 # real QA test starts here
32 _require_scratch_reflink
37 _scratch_mkfs >/dev/null 2>&1
39 blksz=$(_get_file_block_size $SCRATCH_MNT)
42 echo "Format and mount"
43 _scratch_mkfs -d agsize=$((16384 * $blksz)) > $seqres.full 2>&1
44 _scratch_mount >> $seqres.full 2>&1
46 testdir=$SCRATCH_MNT/test-$seq
49 echo "Create the original files"
50 sz=$((20480 * $blksz))
51 _pwrite_byte 0x61 0 $sz $testdir/file1 >> $seqres.full
52 _cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full
55 echo "CoW every other block"
56 _pwrite_byte 0x62 0 $sz $testdir/file1 >> $seqres.full
60 od -t x1 $testdir/file1 | _filter_od
61 od -t x1 $testdir/file2 | _filter_od
62 #filefrag -v $testdir/file1 $testdir/file2