2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2020 Red Hat, Inc.. All Rights Reserved.
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
11 # Regression test for commit:
12 # xfs: Skip repetitive warnings about mount options
15 seqres=$RESULT_DIR/$seq
16 echo "QA output created by $seq"
20 status=1 # failure is the default!
21 trap "_cleanup; exit \$status" 0 1 2 3 15
29 # get standard environment, filters and checks
32 # remove previous $seqres.full before test
41 echo "fstests $seqnum [tag]" > /dev/kmsg
44 dmesg_since_test_tag()
46 dmesg | tac | sed -ne "0,\#fstests $seqnum \[tag\]#p" | \
50 check_dmesg_for_since_tag()
52 dmesg_since_test_tag | egrep -q "$1"
55 echo "Silence is golden."
58 # Skip old kernels that did not print the warning yet
60 _scratch_mkfs > $seqres.full 2>&1
61 _scratch_mount -o attr2
63 check_dmesg_for_since_tag "XFS: attr2 mount option is deprecated" || \
64 _notrun "Deprecation warning are not printed at all."
66 # Test mount with default options (attr2 and noikeep) and remount with
68 # 1) the defaults (attr2, noikeep)
69 # 2) non defaults (noattr2, ikeep)
71 for VAR in {attr2,noikeep}; do
74 check_dmesg_for_since_tag "XFS: $VAR mount option is deprecated." && \
75 echo "Should not be able to find deprecation warning for $VAR"
77 for VAR in {noattr2,ikeep}; do
80 check_dmesg_for_since_tag "XFS: $VAR mount option is deprecated" || \
81 echo "Could not find deprecation warning for $VAR"