Skip to contentSkip to conversation

orangefs: rate limit the client not running info message

PATCH In review Colin King 2 participants 2 messages Sep 5, 2018 – Sep 7, 2018

Subsystems (2)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 orangefs: rate limit the client not running info message

From: Colin Ian King <[email protected]>

Currently accessing various /sys/fs/orangefs files will spam the kernel log with the following info message when the client is not running:

[  491.489284] sysfs_service_op_show: Client not running :-5:

Rate limit this info message to make it less spammy.

---
 fs/orangefs/orangefs-sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/orangefs/orangefs-sysfs.c +1 -1
index dd28079f518c..19739aaee675 100644
@@ -323,7 +323,7 @@ static ssize_t sysfs_service_op_show(struct kobject *kobj,
 	/* Can't do a service_operation if the client is not running... */
 	rc = is_daemon_in_service();
 	if (rc) {
-		pr_info("%s: Client not running :%d:\n",
+		pr_info_ratelimited("%s: Client not running :%d:\n",
 			__func__,
 			is_daemon_in_service());
 		goto out;
Signature · 1 line
2.17.1
maintainer
#1 lore raw

Thanks... I've applied your patch to 4.19-rc2 and run it through xfstests. It is in my linux-next tree now.

I put that in there because I'm really just an old system administrator, and I would always be happy when I could tail dmesg and see some hint at why something wasn't doing as I expected.

I just looked in ratelimit.h and at the ratelimit macros in printk.h, I should try to think about those more when adding sysadmin-alert messages.

-Mike

Quoted 32 lines · Colin King

From: Colin Ian King <[email protected]>

Currently accessing various /sys/fs/orangefs files will spam the kernel log with the following info message when the client is not running:

[  491.489284] sysfs_service_op_show: Client not running :-5:

Rate limit this info message to make it less spammy.

---
 fs/orangefs/orangefs-sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/orangefs/orangefs-sysfs.c +1 -2
index dd28079f518c..19739aaee675 100644
@@ -323,7 +323,7 @@ static ssize_t sysfs_service_op_show(struct kobject *kobj,
        /* Can't do a service_operation if the client is not running... */
        rc = is_daemon_in_service();
        if (rc) {
-               pr_info("%s: Client not running :%d:\n",
+               pr_info_ratelimited("%s: Client not running :%d:\n",
                        __func__,
                        is_daemon_in_service());
                goto out;
--

2.17.1