generic: test for file loss after mix of rename, fsync and inode eviction
[xfstests-dev.git] / tests / generic / 630
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0-or-later
3 # Copyright (c) 2021 Oracle.  All Rights Reserved.
4 #
5 # FS QA Test No. 630
6 #
7 # Make sure that mmap and file writers racing with FIDEDUPERANGE cannot write
8 # to the file after the dedupe prep function has decided that the file contents
9 # are identical and we can therefore go ahead with the remapping.
10
11 . ./common/preamble
12 _begin_fstest auto quick rw dedupe clone
13
14 # Import common functions.
15 . ./common/reflink
16
17 # real QA test starts here
18 _supported_fs generic
19 _require_scratch_dedupe
20 _require_test_program "deduperace"
21
22 nr_ops=$((TIME_FACTOR * 10000))
23
24 # Format filesystem
25 _scratch_mkfs > $seqres.full
26 _scratch_mount
27
28 # Test once with mmap writes
29 $here/src/deduperace -c $SCRATCH_MNT -n $nr_ops
30
31 # Test again with pwrites for the lulz
32 $here/src/deduperace -c $SCRATCH_MNT -n $nr_ops -w
33
34 echo Silence is golden.
35 # success, all done
36 status=0
37 exit