summaryrefslogtreecommitdiff
path: root/tests/xfs/539
blob: 778dce852cae48f2d0763b93a81083be9a8fbbdc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2020 Red Hat, Inc.. All Rights Reserved.
#
# FS QA Test 539
#
# https://bugzilla.kernel.org/show_bug.cgi?id=211605
# Verify that the warnings are not printed on remount if the mount option has
# the same value as during the mount
#
# Regression test for commit:
# 92cf7d36384b xfs: Skip repetitive warnings about mount options

. ./common/preamble
_begin_fstest auto quick mount

# Import common functions.

_supported_fs xfs
_fixed_by_kernel_commit 92cf7d36384b \
	"xfs: Skip repetitive warnings about mount options"

_require_check_dmesg
_require_scratch

log_tag()
{
	echo "fstests $seqnum [tag]" > /dev/kmsg
}

dmesg_since_test_tag()
{
	dmesg | tac | sed -ne "0,\#fstests $seqnum \[tag\]#p" | \
		tac
}

check_dmesg_for_since_tag()
{
	dmesg_since_test_tag | grep -E -q "$1"
}

echo "Silence is golden."

# Skip old kernels that did not print the warning yet
log_tag
_scratch_mkfs > $seqres.full 2>&1
_scratch_mount -o attr2
_scratch_unmount
check_dmesg_for_since_tag "XFS: attr2 mount option is deprecated" || \
	_notrun "Deprecation warning are not printed at all."

# Test mount with default options (attr2 and noikeep) and remount with
# 2 groups of options
# 1) the defaults (attr2, noikeep)
# 2) non defaults (noattr2, ikeep)
_scratch_mount
for VAR in {attr2,noikeep}; do
	log_tag
	_scratch_remount $VAR
	check_dmesg_for_since_tag "XFS: $VAR mount option is deprecated." && \
		echo "Should not be able to find deprecation warning for $VAR"
done
for VAR in {noattr2,ikeep}; do
	log_tag
	_scratch_remount $VAR
	check_dmesg_for_since_tag "XFS: $VAR mount option is deprecated" || \
		echo "Could not find deprecation warning for $VAR"
done
_scratch_unmount

# success, all done
status=0
exit