2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (C) 2020 SUSE Linux Products GmbH. All Rights Reserved.
7 # Test that after doing a memory mapped write to an empty file, a call to
8 # stat(2) reports a non-zero number of used blocks.
11 _begin_fstest auto quick rw
13 # Import common functions.
16 # real QA test starts here
20 _scratch_mkfs >>$seqres.full 2>&1
23 $XFS_IO_PROG -f -c "truncate 64K" \
25 -c "mwrite -S 0xab 0 64K" \
27 $SCRATCH_MNT/foobar | _filter_xfs_io
29 blocks_used=$(stat -c %b $SCRATCH_MNT/foobar)
30 if [ $blocks_used -eq 0 ]; then
31 echo "error: stat(2) reported 0 used blocks"
34 echo "Silence is golden"