[PATCH] fix comment for __printk_ratelimit

Previous thread: [PATCH] capabilities: fix sys_prctl() returned uninitialized value by Shi Weihua on Wednesday, May 21, 2008 - 2:37 am. (3 messages)

Next thread: [PATCH] [POWERPC] Add i2c pins to dts and board setup by Jochen Friedrich on Wednesday, May 21, 2008 - 3:31 am. (3 messages)
From: Uwe Kleine-König
Date: Wednesday, May 21, 2008 - 3:20 am

The comment assumed ratelimit_burst to be one and used an old name for
ratelimit_jiffies.

I also reintended the comment.

Signed-off-by: Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
---
 kernel/printk.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/kernel/printk.c b/kernel/printk.c
index 8fb01c3..f1c3c1c 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -1323,9 +1323,8 @@ void tty_write_message(struct tty_struct *tty, char *msg)
 /*
  * printk rate limiting, lifted from the networking subsystem.
  *
- * This enforces a rate limit: not more than one kernel message
- * every printk_ratelimit_jiffies to make a denial-of-service
- * attack impossible.
+ * This enforces a rate limit: not more than @ratelimit_burst kernel message
+ * every @ratelimit_jiffies to make a denial-of-service attack impossible.
  */
 int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst)
 {
-- 
1.5.5.1

--

From: Uwe Kleine-König
Date: Tuesday, July 29, 2008 - 12:39 am

The comment assumed the burst to be one and the ratelimit used to be named
printk_ratelimit_jiffies.

Signed-off-by: Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
Cc: Dave Young <hidave.darkstar@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
---
Hello,

The comment was already wrong before commit

	717115e... printk ratelimiting rewrite

but I selected the Cc: list from this commit.

@trivial: I already sent a patch that updates the comment to the state before
717115e.  You probably should drop this now as it became wrong.

Best regards
Uwe

 kernel/printk.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/printk.c b/kernel/printk.c
index a7f7559..b51b156 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -1309,14 +1309,14 @@ void tty_write_message(struct tty_struct *tty, char *msg)
 
 #if defined CONFIG_PRINTK
 
-DEFINE_RATELIMIT_STATE(printk_ratelimit_state, 5 * HZ, 10);
 /*
  * printk rate limiting, lifted from the networking subsystem.
  *
- * This enforces a rate limit: not more than one kernel message
- * every printk_ratelimit_jiffies to make a denial-of-service
- * attack impossible.
+ * This enforces a rate limit: not more than 10 kernel messages
+ * every 5s to make a denial-of-service attack impossible.
  */
+DEFINE_RATELIMIT_STATE(printk_ratelimit_state, 5 * HZ, 10);
+
 int printk_ratelimit(void)
 {
 	return __ratelimit(&printk_ratelimit_state);
-- 
1.5.6.3

--

Previous thread: [PATCH] capabilities: fix sys_prctl() returned uninitialized value by Shi Weihua on Wednesday, May 21, 2008 - 2:37 am. (3 messages)

Next thread: [PATCH] [POWERPC] Add i2c pins to dts and board setup by Jochen Friedrich on Wednesday, May 21, 2008 - 3:31 am. (3 messages)