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 DIO CoW across not-block-aligned EOF.
10 _begin_fstest auto quick clone
12 # Override the default cleanup function.
16 rm -rf $tmp.* $testdir
19 # Import common functions.
23 # real QA test starts here
24 _require_scratch_reflink
28 echo "Format and mount"
29 _scratch_mkfs > $seqres.full 2>&1
30 _scratch_mount >> $seqres.full 2>&1
32 testdir=$SCRATCH_MNT/test-$seq
35 echo "Create the original files"
37 _pwrite_byte 0x61 0 $((blksz + 17)) $testdir/file1 >> $seqres.full
38 _cp_reflink $testdir/file1 $testdir/file2
39 _pwrite_byte 0x61 0 $((blksz + 17)) $testdir/file2.chk >> $seqres.full
43 md5sum $testdir/file1 | _filter_scratch
44 md5sum $testdir/file2 | _filter_scratch
45 md5sum $testdir/file2.chk | _filter_scratch
47 echo "CoW and unmount"
48 $XFS_IO_PROG -d -f -c "pwrite -S 0x63 $blksz $blksz" $testdir/file2 >> $seqres.full
49 $XFS_IO_PROG -f -c "pwrite -S 0x63 $blksz $blksz" $testdir/file2.chk >> $seqres.full
53 md5sum $testdir/file1 | _filter_scratch
54 md5sum $testdir/file2 | _filter_scratch
55 md5sum $testdir/file2.chk | _filter_scratch