Re: [PATCH 1/2] [SCSI] Print only a single message "rejecting I/O to device being removed"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 07 2006, James Bottomley wrote:
> On Mon, 2006-11-06 at 22:00 +0100, Jens Axboe wrote:
> > So, again, I'll ask James' (this time cc'ed) opinion on what he thinks.
> > Perhaps he agrees that we should go the ratelimit route, or perhaps he
> > likes your version.  If the former, I'll be happy to code that up
> > (should be a 1 minute job).
> 
> I agree we should be using the standard tools rather than inventing our
> own, so printk_ratelimit() would be the correct way to do this.

Alright, then it turns into something like this:

-----

[SCSI] Rate limit IO reject messages

Otherwise we can flood the system with messages when a device is
removed.

Signed-off-by: Jens Axboe <jens.axboe@xxxxxxxxxx>

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index d2c02df..a935b9d 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1149,7 +1149,8 @@ static int scsi_prep_fn(struct request_q
 			    specials_only == SDEV_BLOCK)
 				goto defer;
 			
-			sdev_printk(KERN_ERR, sdev,
+			if (printk_ratelimit())
+				sdev_printk(KERN_ERR, sdev,
 				    "rejecting I/O to device being removed\n");
 			goto kill;
 		}


-- 
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux