common/rc: add _scratch_{u}mount_idmapped() helpers
[xfstests-dev.git] / tests / generic / 623
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0-only
3 # Copyright 2021 Red Hat, Inc.
4 #
5 # FS QA Test No. 623
6 #
7 # Test a write fault scenario on a shutdown fs.
8 #
9 seq=`basename $0`
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
12
13 here=`pwd`
14 tmp=/tmp/$$
15 status=1        # failure is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 15
17
18 _cleanup()
19 {
20         rm -f $tmp.*
21 }
22
23 . ./common/rc
24 . ./common/filter
25
26 rm -f $seqres.full
27
28 _supported_fs generic
29 _require_scratch_nocheck
30 _require_scratch_shutdown
31
32 _scratch_mkfs &>> $seqres.full
33 _scratch_mount
34
35 # XFS had a regression where it failed to check shutdown status in the fault
36 # path. This produced an iomap warning because writeback failure clears Uptodate
37 # status on the page.
38 file=$SCRATCH_MNT/file
39 $XFS_IO_PROG -fc "pwrite 0 4k" -c fsync $file | _filter_xfs_io
40 ulimit -c 0
41 $XFS_IO_PROG -x -c "mmap 0 4k" -c "mwrite 0 4k" -c shutdown -c fsync \
42         -c "mwrite 0 4k" $file | _filter_xfs_io
43
44 # success, all done
45 status=0
46 exit