summaryrefslogtreecommitdiff
path: root/tests/generic/630
blob: f1ea6b17de1bba4d72b8f7d4e5f511c970f812fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (c) 2021 Oracle.  All Rights Reserved.
#
# FS QA Test No. 630
#
# Make sure that mmap and file writers racing with FIDEDUPERANGE cannot write
# to the file after the dedupe prep function has decided that the file contents
# are identical and we can therefore go ahead with the remapping.

. ./common/preamble
_begin_fstest auto quick rw dedupe clone

# Import common functions.
. ./common/reflink

# real QA test starts here
_supported_fs generic
_require_scratch_dedupe
_require_test_program "deduperace"

nr_ops=$((TIME_FACTOR * 10000))

# Format filesystem
_scratch_mkfs > $seqres.full
_scratch_mount

# Test once with mmap writes
$here/src/deduperace -c $SCRATCH_MNT -n $nr_ops

# Test again with pwrites for the lulz
$here/src/deduperace -c $SCRATCH_MNT -n $nr_ops -w

echo Silence is golden.
# success, all done
status=0
exit