2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2015 Oracle, Inc. All Rights Reserved.
7 # Test for race between delete a file while rewriting its reflinked twin
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 7 15
25 # get standard environment, filters and checks
30 # real QA test starts here
32 _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
45 echo "Initialize files"
47 _pwrite_byte 0x61 0 $((loops * blksz)) $testdir/file1 >> $seqres.full
48 _cp_reflink $testdir/file1 $testdir/file2
51 echo "Delete while rewriting"
52 rm -rf $testdir/file1 &
53 _pwrite_byte 0x62 0 $((loops * blksz)) $testdir/file1 >> $seqres.full