From: Andrew Morton Date: Thu, 28 Oct 2010 12:15:26 +0000 (-0600) Subject: drivers/block/aoe/aoeblk.c: ratelimit a warning printk X-Git-Tag: v2.6.37-rc1~75^2~2 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=027b180d7405f2b2df25e2a8b1b796b00f3773cf;p=linux.git drivers/block/aoe/aoeblk.c: ratelimit a warning printk As described in https://bugzilla.kernel.org/show_bug.cgi?id=19922 : I had an AoE device go down overnight, and while a server was trying to : write to it, it was also writing this message to its logs: : : 209 printk(KERN_INFO "aoe: device %ld.%d is not up\n", : 210 d->aoemajor, d->aoeminor); : : The message appeared many times per second, and over several hours : produced about 7.5 gigabytes of log files, filling up all free space on : the root filesystem. Cc: "Ed L. Cashin" Suggested-by: Roman Mamedov Signed-off-by: Andrew Morton Signed-off-by: Jens Axboe --- diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c index f21c237a9e5e..541e18879965 100644 --- a/drivers/block/aoe/aoeblk.c +++ b/drivers/block/aoe/aoeblk.c @@ -4,12 +4,14 @@ * block device routines */ +#include #include #include #include #include #include #include +#include #include #include #include @@ -207,7 +209,7 @@ aoeblk_make_request(struct request_queue *q, struct bio *bio) spin_lock_irqsave(&d->lock, flags); if ((d->flags & DEVFL_UP) == 0) { - printk(KERN_INFO "aoe: device %ld.%d is not up\n", + pr_info_ratelimited("aoe: device %ld.%d is not up\n", d->aoemajor, d->aoeminor); spin_unlock_irqrestore(&d->lock, flags); mempool_free(buf, d->bufpool);