blob: 33b3c99633cfe29aed64ccca1acb1e2bb040703b (
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
|
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (c) 2021 Oracle. All Rights Reserved.
#
# FS QA Test No. 147
#
# Make sure we validate realtime extent size alignment for fallocate modes.
# This is a regression test for fe341eb151ec ("xfs: ensure that fpunch,
# fcollapse, and finsert operations are aligned to rt extent size")
. ./common/preamble
_begin_fstest auto quick rw realtime collapse insert unshare zero prealloc
# Import common functions.
. ./common/filter
# real QA test starts here
_supported_fs xfs
_require_scratch
_require_realtime
_require_xfs_io_command "fcollapse"
_require_xfs_io_command "finsert"
_require_xfs_io_command "funshare"
_require_xfs_io_command "fzero"
_require_xfs_io_command "falloc"
# Format filesystem with a 256k realtime extent size
_scratch_mkfs -r extsize=256k > $seqres.full
_scratch_mount >> $seqres.full
blksz=$(_get_block_size $SCRATCH_MNT)
rextsize=$(_xfs_get_rtextsize "$SCRATCH_MNT")
rextblks=$((rextsize / blksz))
echo "blksz $blksz rextsize $rextsize rextblks $rextblks" >> $seqres.full
# Make sure the root directory has rtinherit set so our test file will too
_xfs_force_bdev realtime $SCRATCH_MNT
sz=$((rextsize * 100))
range="$((blksz * 3)) $blksz"
for verb in fpunch finsert fcollapse fzero funshare falloc; do
echo "test $verb"
$XFS_IO_PROG -f -c "falloc 0 $sz" "$SCRATCH_MNT/b"
$XFS_IO_PROG -f -c "$verb $range" "$SCRATCH_MNT/b"
rm -f "$SCRATCH_MNT/b"
_scratch_cycle_mount
done
# success, all done
status=0
exit
|