blob: 3e2a587c8f9019e47fbe0595c62bc9bc86ebba7e (
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
|
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2020 SUSE Linux Products GmbH. All Rights Reserved.
#
# FS QA Test No. 614
#
# Test that after doing a memory mapped write to an empty file, a call to
# stat(2) reports a non-zero number of used blocks.
#
. ./common/preamble
_begin_fstest auto quick rw
# Import common functions.
. ./common/filter
# real QA test starts here
_supported_fs generic
_require_scratch
_require_scratch_delalloc
_scratch_mkfs >>$seqres.full 2>&1
_scratch_mount
$XFS_IO_PROG -f -c "truncate 64K" \
-c "mmap -w 0 64K" \
-c "mwrite -S 0xab 0 64K" \
-c "munmap" \
$SCRATCH_MNT/foobar | _filter_xfs_io
blocks_used=$(stat -c %b $SCRATCH_MNT/foobar)
if [ $blocks_used -eq 0 ]; then
echo "error: stat(2) reported 0 used blocks"
fi
echo "Silence is golden"
status=0
exit
|