generic: test for file loss after mix of rename, fsync and inode eviction
[xfstests-dev.git] / tests / generic / 094
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2015 Facebook.  All Rights Reserved.
4 #
5 # FS QA Test No. 094
6 #
7 # Run the fiemap (file extent mapping) tester with preallocation enabled
8 #
9 . ./common/preamble
10 _begin_fstest auto quick prealloc
11
12 # Import common functions.
13 . ./common/filter
14
15 # real QA test starts here
16 _supported_fs generic
17 _require_scratch
18 _require_odirect
19 _require_xfs_io_command "fiemap"
20 _require_xfs_io_command "falloc"
21
22 _scratch_mkfs > /dev/null 2>&1
23 _scratch_mount > /dev/null 2>&1
24
25 fiemapfile=$SCRATCH_MNT/$seq.fiemap
26
27 _require_test_program "fiemap-tester"
28
29 # FIEMAP test doesn't like finding unwritten blocks after it punches out
30 # a partial rt extent.
31 test "$FSTYP" = "xfs" && \
32         _require_file_block_size_equals_fs_block_size $SCRATCH_MNT
33
34 seed=`date +%s`
35
36 echo "using seed $seed" >> $seqres.full
37
38 echo "fiemap run with sync"
39 $here/src/fiemap-tester -q -S -s $seed -r 200 $fiemapfile 2>&1 | \
40         tee -a $seqres.full
41
42 echo "fiemap run without sync"
43 $here/src/fiemap-tester -q -s $seed -r 200 $fiemapfile 2>&1 | \
44         tee -a $seqres.full
45
46 status=0
47 exit