Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 641de9d8 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Linus Torvalds
Browse files

printk: fix comment for printk ratelimiting



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

Signed-off-by: default avatarUwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
Cc: Dave Young <hidave.darkstar@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 8f3d137e
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -1309,14 +1309,14 @@ void tty_write_message(struct tty_struct *tty, char *msg)


#if defined CONFIG_PRINTK
#if defined CONFIG_PRINTK


DEFINE_RATELIMIT_STATE(printk_ratelimit_state, 5 * HZ, 10);
/*
/*
 * printk rate limiting, lifted from the networking subsystem.
 * printk rate limiting, lifted from the networking subsystem.
 *
 *
 * This enforces a rate limit: not more than one kernel message
 * This enforces a rate limit: not more than 10 kernel messages
 * every printk_ratelimit_jiffies to make a denial-of-service
 * every 5s to make a denial-of-service attack impossible.
 * attack impossible.
 */
 */
DEFINE_RATELIMIT_STATE(printk_ratelimit_state, 5 * HZ, 10);

int printk_ratelimit(void)
int printk_ratelimit(void)
{
{
	return __ratelimit(&printk_ratelimit_state);
	return __ratelimit(&printk_ratelimit_state);