[PATCH] vfs: Remove stray debug log, add func name to fs_validate_description

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>From bf5d3636beeeafc84c4c40deb5a935a5b4554f55 Mon Sep 17 00:00:00 2001
From: Colin Walters <walters@xxxxxxxxxx>
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@xxxxxxxxxx>
---
 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




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux