From: "Colin Walters" <walters@verbum.org>
To: "David Howells" <dhowells@redhat.com>, linux-fsdevel@vger.kernel.org
Subject: [PATCH] vfs: Remove stray debug log, add func name to fs_validate_description
Date: Wed, 05 Feb 2020 10:49:10 -0500 [thread overview]
Message-ID: <f705c324-4cc6-477d-b3bb-308b25add4d4@www.fastmail.com> (raw)
From bf5d3636beeeafc84c4c40deb5a935a5b4554f55 Mon Sep 17 00:00:00 2001
From: Colin Walters <walters@verbum.org>
Date: Wed, 5 Feb 2020 15:19:11 +0000
Subject: [PATCH] vfs: Remove stray debug log, add func name to
fs_validate_description
I was recently looking at the logs of a kernel bootup for an
unrelated reason and came across `*** VALIDATE bpf` and wondered
what it meant - was something loading a BPF module at boot?
A quick grep led me to this code, and I think this is just a
stray debugging message. If we *do* want this message I think
it'd probably be better done in `register_filesystem()` or so?
Further, clean up the `pr_err` usage here to look like many other
places in the kernel which prefix with `__func__`. The
capitalized `VALIDATE` is both "shouty" and more importantly too
generic to easily lead to the right place via an Internet search
engine. `VALIDATE bpf` in particular could mean a lot of things,
but `fs_validate_description bpf` should lead directly to
the Linux kernel source here.
Signed-off-by: Colin Walters <walters@verbum.org>
---
fs/fs_parser.c | 33 ++++++++++++++++-----------------
1 file changed, 16 insertions(+), 17 deletions(-)
diff --git a/fs/fs_parser.c b/fs/fs_parser.c
index d1930adce68d..a184e23f5f18 100644
--- a/fs/fs_parser.c
+++ b/fs/fs_parser.c
@@ -365,10 +365,8 @@ bool fs_validate_description(const struct fs_parameter_description *desc)
unsigned int nr_params = 0;
bool good = true, enums = false;
- pr_notice("*** VALIDATE %s ***\n", name);
-
if (!name[0]) {
- pr_err("VALIDATE Parser: No name\n");
+ pr_err("%s: no name\n", __func__);
name = "Unknown";
good = false;
}
@@ -380,8 +378,8 @@ bool fs_validate_description(const struct fs_parameter_description *desc)
/* Check that the type is in range */
if (t == __fs_param_wasnt_defined ||
t >= nr__fs_parameter_type) {
- pr_err("VALIDATE %s: PARAM[%s] Bad type %u\n",
- name, param->name, t);
+ pr_err("%s %s: PARAM[%s] Bad type %u\n",
+ __func__, name, param->name, t);
good = false;
} else if (t == fs_param_is_enum) {
enums = true;
@@ -390,8 +388,8 @@ bool fs_validate_description(const struct fs_parameter_description *desc)
/* Check for duplicate parameter names */
for (p2 = desc->specs; p2 < param; p2++) {
if (strcmp(param->name, p2->name) == 0) {
- pr_err("VALIDATE %s: PARAM[%s]: Duplicate\n",
- name, param->name);
+ pr_err("%s %s: PARAM[%s]: Duplicate\n",
+ __func__, name, param->name);
good = false;
}
}
@@ -402,14 +400,14 @@ bool fs_validate_description(const struct fs_parameter_description *desc)
if (desc->enums) {
if (!nr_params) {
- pr_err("VALIDATE %s: Enum table but no parameters\n",
- name);
+ pr_err("%s %s: Enum table but no parameters\n",
+ __func__, name);
good = false;
goto no_enums;
}
if (!enums) {
- pr_err("VALIDATE %s: Enum table but no enum-type values\n",
- name);
+ pr_err("%s %s: Enum table but no enum-type values\n",
+ __func__, name);
good = false;
goto no_enums;
}
@@ -421,8 +419,9 @@ bool fs_validate_description(const struct fs_parameter_description *desc)
for (param = desc->specs; param->name; param++) {
if (param->opt == e->opt &&
param->type != fs_param_is_enum) {
- pr_err("VALIDATE %s: e[%tu] enum val for %s\n",
- name, e - desc->enums, param->name);
+ pr_err("%s %s: e[%tu] enum val for %s\n",
+ __func__, name, e - desc->enums,
+ param->name);
good = false;
}
}
@@ -438,15 +437,15 @@ bool fs_validate_description(const struct fs_parameter_description *desc)
if (e->opt == param->opt)
break;
if (!e->name[0]) {
- pr_err("VALIDATE %s: PARAM[%s] enum with no values\n",
- name, param->name);
+ pr_err("%s %s: PARAM[%s] enum with no values\n",
+ __func__, name, param->name);
good = false;
}
}
} else {
if (enums) {
- pr_err("VALIDATE %s: enum-type values, but no enum table\n",
- name);
+ pr_err("%s %s: enum-type values, but no enum table\n",
+ __func__, name);
good = false;
goto no_enums;
}
--
2.24.1
reply other threads:[~2020-02-05 15:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f705c324-4cc6-477d-b3bb-308b25add4d4@www.fastmail.com \
--to=walters@verbum.org \
--cc=dhowells@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).