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
31 # Below agsize (16384 * $blksz) is too small for a large fs, and it's not
32 # necessary to test on large fs
33 _require_no_large_scratch_dev
34 _require_scratch_reflink
39 _scratch_mkfs >/dev/null 2>&1
41 blksz=$(_get_file_block_size $SCRATCH_MNT)
44 echo "Format and mount"
45 _scratch_mkfs -d agsize=$((16384 * $blksz)) > $seqres.full 2>&1
46 _scratch_mount >> $seqres.full 2>&1
48 testdir=$SCRATCH_MNT/test-$seq
51 echo "Create the original files"
52 sz=$((20480 * $blksz))
53 _pwrite_byte 0x61 0 $sz $testdir/file1 >> $seqres.full
54 _cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full
57 echo "CoW every other block"
58 _pwrite_byte 0x62 0 $sz $testdir/file1 >> $seqres.full
62 od -t x1 $testdir/file1 | _filter_od
63 od -t x1 $testdir/file2 | _filter_od
64 #filefrag -v $testdir/file1 $testdir/file2