generic: test MADV_POPULATE_READ with IO errors
[xfstests-dev.git] / tests / xfs / 246
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2016, Oracle and/or its affiliates.  All Rights Reserved.
4 #
5 # FS QA Test No. 246
6 #
7 # Create an empty file and try to query the (nonexistant) CoW fork.
8 #
9 . ./common/preamble
10 _begin_fstest auto quick clone
11
12 # Import common functions.
13 . ./common/filter
14
15 # real QA test starts here
16 _supported_fs xfs
17 _require_xfs_debug
18 _require_xfs_io_command "bmap" "-c"
19 _require_scratch
20
21 echo "Format and mount"
22 _scratch_mkfs > $seqres.full 2>&1
23 _scratch_mount >> $seqres.full 2>&1
24
25 testdir=$SCRATCH_MNT/test-$seq
26 mkdir $testdir
27
28 echo "Create the original files"
29 touch $testdir/file1
30 sync
31
32 echo "Dump extents after sync"
33 echo "Hole CoW extents:"
34 $XFS_IO_PROG -c "bmap -clpv" $testdir/file1 | _filter_scratch
35
36 # success, all done
37 status=0
38 exit