From c4a3d8a1bd9d7d3d2a1a41d6eca182bd7c050682 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Thu, 22 May 2014 10:44:11 +1000 Subject: [PATCH] sysctl: flip file position warning to pr_warn_once To avoid dmesg flooding, use pr_warn_once instead of pr_warn. Signed-off-by: Kees Cook Suggested-by: Andrew Morton Signed-off-by: Andrew Morton --- kernel/sysctl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 51bbf904d694..27e19ba04049 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -1783,10 +1783,10 @@ static int _proc_do_string(char *data, int maxlen, int write, static void warn_sysctl_write(struct ctl_table *table) { - pr_warn("write to %s by %s used a non-zero file position!\n", - table->procname, current->comm); - pr_warn("This will not be supported in the future.\n"); - pr_warn("To silence warning, set kernel.sysctl_writes_strict = -1\n"); + pr_warn_once("%s wrote to %s when file position was not 0!\n" + "This will not be supported in the future. To silence this\n" + "warning, set kernel.sysctl_writes_strict = -1\n", + current->comm, table->procname); } /** -- 2.39.5