generic: test MADV_POPULATE_READ with IO errors
[xfstests-dev.git] / tests / generic / 514
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2018 Oracle, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 514
6 #
7 # Ensure that file size resource limits are respected when reflinking.
8 #
9 . ./common/preamble
10 _begin_fstest auto quick clone
11
12 # Import common functions.
13 . ./common/filter
14 . ./common/reflink
15
16 # real QA test starts here
17 _supported_fs generic
18 _require_scratch_reflink
19 _require_user
20
21 _scratch_mkfs >>$seqres.full 2>&1
22 _scratch_mount
23
24 chmod a+rwx $SCRATCH_MNT
25 $XFS_IO_PROG -f -c "pwrite -S 0x18 0 1m" $SCRATCH_MNT/foo >>$seqres.full
26 su -s/bin/bash - $qa_user -c "ulimit -f 64 ; $XFS_IO_PROG -f -c \"reflink $SCRATCH_MNT/foo\" $SCRATCH_MNT/bar" >> $seqres.full 2>&1
27
28 sz="$(_get_filesize $SCRATCH_MNT/bar)"
29 if [ "$sz" -ne 0 ] && [ "$sz" -ne 65536 ]; then
30         echo "Oddball file size $sz??"
31 fi
32
33 echo Silence is golden.
34 status=0
35 exit