2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2015, Oracle and/or its affiliates. All Rights Reserved.
7 # See what happens if we CoW across not-block-aligned EOF.
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
15 status=1 # failure is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 15
21 rm -rf $tmp.* $testdir
24 # get standard environment, filters and checks
29 # real QA test starts here
30 _require_scratch_reflink
35 echo "Format and mount"
36 _scratch_mkfs > $seqres.full 2>&1
37 _scratch_mount >> $seqres.full 2>&1
39 testdir=$SCRATCH_MNT/test-$seq
42 echo "Create the original files"
44 _pwrite_byte 0x61 0 $((blksz + 17)) $testdir/file1 >> $seqres.full
45 _cp_reflink $testdir/file1 $testdir/file2
46 _pwrite_byte 0x61 0 $((blksz + 17)) $testdir/file2.chk >> $seqres.full
50 md5sum $testdir/file1 | _filter_scratch
51 md5sum $testdir/file2 | _filter_scratch
52 md5sum $testdir/file2.chk | _filter_scratch
54 echo "CoW and unmount"
55 $XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz + 17)) 17" $testdir/file2 >> $seqres.full
56 $XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz + 17)) 17" $testdir/file2.chk >> $seqres.full
60 md5sum $testdir/file1 | _filter_scratch
61 md5sum $testdir/file2 | _filter_scratch
62 md5sum $testdir/file2.chk | _filter_scratch