generic: test MADV_POPULATE_READ with IO errors
[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 . ./common/preamble
10 _begin_fstest auto quick shutdown
11
12 . ./common/filter
13
14 _supported_fs generic
15 _fixed_by_kernel_commit e4826691cc7e \
16         "xfs: restore shutdown check in mapped write fault path"
17
18 _require_scratch_nocheck
19 _require_scratch_shutdown
20
21 _scratch_mkfs &>> $seqres.full
22 _scratch_mount
23
24 # XFS had a regression where it failed to check shutdown status in the fault
25 # path. This produced an iomap warning because writeback failure clears Uptodate
26 # status on the page.
27 file=$SCRATCH_MNT/file
28 $XFS_IO_PROG -fc "pwrite 0 4k" -c fsync $file | _filter_xfs_io
29 ulimit -c 0
30 $XFS_IO_PROG -x -c "mmap 0 4k" -c "mwrite 0 4k" -c shutdown -c fsync \
31         -c "mwrite 0 4k" $file | _filter_xfs_io
32
33 # success, all done
34 status=0
35 exit