blob: 26385d36e1d2a10c53db890db07d788037462f8a (
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2017 Red Hat Inc. All Rights Reserved.
#
# FS QA Test No. 427
#
# Try to trigger a race of free eofblocks and file extending dio writes.
# A known bug of XFS has been fixed by "e4229d6 xfs: fix eofblocks race
# with file extending async dio writes"
#
. ./common/preamble
_begin_fstest auto quick aio rw
# Import common functions.
. ./common/filter
# real QA test starts here
# Modify as appropriate.
_supported_fs generic
_require_scratch
_require_test_program "feature"
_require_aiodio aio-dio-eof-race
# This test requires specific data space usage, skip if we have compression
# enabled.
_require_no_compress
# limit the filesystem size, to save the time of filling filesystem
_scratch_mkfs_sized $((256 * 1024 * 1024)) >>$seqres.full 2>&1
_scratch_mount
# try to write more bytes than filesystem size to fill the filesystem,
# then remove all these data. If we still can find these stale data in
# a file' eofblock, then it's a bug
$XFS_IO_PROG -f -c "pwrite -S 0x55 0 $((256 * 1024 * 1024 * 2))" \
$SCRATCH_MNT/fillfs-$seq 2>/dev/null
rm -f $SCRATCH_MNT/fillfs-$seq
# open & close the file frequently, to trigger xfs_free_eofblocks
while true; do
$XFS_IO_PROG -f -c open $SCRATCH_MNT/tst-aio-dio-eof-race.$seq \
>/dev/null 2>&1
done &
open_close_pid=$!
nr_cpu=`$here/src/feature -o`
fsize=$((nr_cpu * 10))
if [ $fsize -gt 200 ]; then
fsize=200
fi
# start a background aio writer, which does several extending loops
# internally and check data integrality
$AIO_TEST -s $fsize -b 65536 $SCRATCH_MNT/tst-aio-dio-eof-race.$seq
status=$?
kill $open_close_pid
wait $open_close_pid
exit
|