generic: test MADV_POPULATE_READ with IO errors
[xfstests-dev.git] / tests / xfs / 539
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2020 Red Hat, Inc.. All Rights Reserved.
4 #
5 # FS QA Test 539
6 #
7 # https://bugzilla.kernel.org/show_bug.cgi?id=211605
8 # Verify that the warnings are not printed on remount if the mount option has
9 # the same value as during the mount
10 #
11 # Regression test for commit:
12 # 92cf7d36384b xfs: Skip repetitive warnings about mount options
13
14 . ./common/preamble
15 _begin_fstest auto quick mount
16
17 # Import common functions.
18
19 _supported_fs xfs
20 _fixed_by_kernel_commit 92cf7d36384b \
21         "xfs: Skip repetitive warnings about mount options"
22
23 _require_check_dmesg
24 _require_scratch
25
26 log_tag()
27 {
28         echo "fstests $seqnum [tag]" > /dev/kmsg
29 }
30
31 dmesg_since_test_tag()
32 {
33         dmesg | tac | sed -ne "0,\#fstests $seqnum \[tag\]#p" | \
34                 tac
35 }
36
37 check_dmesg_for_since_tag()
38 {
39         dmesg_since_test_tag | grep -E -q "$1"
40 }
41
42 echo "Silence is golden."
43
44 # Skip old kernels that did not print the warning yet
45 log_tag
46 _scratch_mkfs > $seqres.full 2>&1
47 _scratch_mount -o attr2
48 _scratch_unmount
49 check_dmesg_for_since_tag "XFS: attr2 mount option is deprecated" || \
50         _notrun "Deprecation warning are not printed at all."
51
52 # Test mount with default options (attr2 and noikeep) and remount with
53 # 2 groups of options
54 # 1) the defaults (attr2, noikeep)
55 # 2) non defaults (noattr2, ikeep)
56 _scratch_mount
57 for VAR in {attr2,noikeep}; do
58         log_tag
59         _scratch_remount $VAR
60         check_dmesg_for_since_tag "XFS: $VAR mount option is deprecated." && \
61                 echo "Should not be able to find deprecation warning for $VAR"
62 done
63 for VAR in {noattr2,ikeep}; do
64         log_tag
65         _scratch_remount $VAR
66         check_dmesg_for_since_tag "XFS: $VAR mount option is deprecated" || \
67                 echo "Could not find deprecation warning for $VAR"
68 done
69 _scratch_unmount
70
71 # success, all done
72 status=0
73 exit