generic: test for file loss after mix of rename, fsync and inode eviction
[xfstests-dev.git] / tests / generic / 638
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2021 Red Hat Inc.  All Rights Reserved.
4 #
5 # FS QA Test 638
6 #
7 # This case mmaps several pages of a file, alloc pages, copy data with pages
8 # overlapping, e.g:
9 #       +-----------------------+
10 #       |        (copy)         |
11 #       |                       V
12 #    +---------------+---------------+------------
13 #    |AAAA| ........ |AAAA| ... |AAAA|AAAA|
14 #    +---------------+---------------+------------
15 #                       |            ^
16 #                       |   (copy)   |
17 #                       +------------+
18 #
19 # This's a regression test cover kernel commit:
20 #   4f06dd92b5d0 ("fuse: fix write deadlock")
21 #
22 . ./common/preamble
23 _begin_fstest auto quick rw
24
25 # Import common functions.
26 . ./common/filter
27
28 # real QA test starts here
29 _supported_fs generic
30 _require_test
31 _require_test_program "t_mmap_writev_overlap"
32
33 pagesize=`getconf PAGE_SIZE`
34 testfile=$TEST_DIR/mmap-writev-overlap
35 $XFS_IO_PROG -f -c "truncate 0" $testfile
36 $here/src/t_mmap_writev_overlap -b $pagesize -c 2 -l 64 $testfile
37
38 echo "Silence is golden"
39 # success, all done
40 status=0
41 exit