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 # 92cf7d36384b xfs: Skip repetitive warnings about mount options
15 _begin_fstest auto quick mount
17 # Import common functions.
20 _fixed_by_kernel_commit 92cf7d36384b \
21 "xfs: Skip repetitive warnings about mount options"
28 echo "fstests $seqnum [tag]" > /dev/kmsg
31 dmesg_since_test_tag()
33 dmesg | tac | sed -ne "0,\#fstests $seqnum \[tag\]#p" | \
37 check_dmesg_for_since_tag()
39 dmesg_since_test_tag | egrep -q "$1"
42 echo "Silence is golden."
44 # Skip old kernels that did not print the warning yet
46 _scratch_mkfs > $seqres.full 2>&1
47 _scratch_mount -o attr2
49 check_dmesg_for_since_tag "XFS: attr2 mount option is deprecated" || \
50 _notrun "Deprecation warning are not printed at all."
52 # Test mount with default options (attr2 and noikeep) and remount with
54 # 1) the defaults (attr2, noikeep)
55 # 2) non defaults (noattr2, ikeep)
57 for VAR in {attr2,noikeep}; do
60 check_dmesg_for_since_tag "XFS: $VAR mount option is deprecated." && \
61 echo "Should not be able to find deprecation warning for $VAR"
63 for VAR in {noattr2,ikeep}; do
66 check_dmesg_for_since_tag "XFS: $VAR mount option is deprecated" || \
67 echo "Could not find deprecation warning for $VAR"