diff options
Diffstat (limited to 'drivers/scsi/sg.c')
-rw-r--r-- | drivers/scsi/sg.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 909ed9ed24c0..441a1c5b8974 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c | |||
@@ -50,6 +50,7 @@ static int sg_version_num = 30534; /* 2 digits for each component */ | |||
50 | #include <linux/delay.h> | 50 | #include <linux/delay.h> |
51 | #include <linux/blktrace_api.h> | 51 | #include <linux/blktrace_api.h> |
52 | #include <linux/mutex.h> | 52 | #include <linux/mutex.h> |
53 | #include <linux/ratelimit.h> | ||
53 | 54 | ||
54 | #include "scsi.h" | 55 | #include "scsi.h" |
55 | #include <scsi/scsi_dbg.h> | 56 | #include <scsi/scsi_dbg.h> |
@@ -626,14 +627,15 @@ sg_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos) | |||
626 | */ | 627 | */ |
627 | if (hp->dxfer_direction == SG_DXFER_TO_FROM_DEV) { | 628 | if (hp->dxfer_direction == SG_DXFER_TO_FROM_DEV) { |
628 | static char cmd[TASK_COMM_LEN]; | 629 | static char cmd[TASK_COMM_LEN]; |
629 | if (strcmp(current->comm, cmd) && printk_ratelimit()) { | 630 | if (strcmp(current->comm, cmd)) { |
630 | printk(KERN_WARNING | 631 | printk_ratelimited(KERN_WARNING |
631 | "sg_write: data in/out %d/%d bytes for SCSI command 0x%x--" | 632 | "sg_write: data in/out %d/%d bytes " |
632 | "guessing data in;\n " | 633 | "for SCSI command 0x%x-- guessing " |
633 | "program %s not setting count and/or reply_len properly\n", | 634 | "data in;\n program %s not setting " |
634 | old_hdr.reply_len - (int)SZ_SG_HEADER, | 635 | "count and/or reply_len properly\n", |
635 | input_size, (unsigned int) cmnd[0], | 636 | old_hdr.reply_len - (int)SZ_SG_HEADER, |
636 | current->comm); | 637 | input_size, (unsigned int) cmnd[0], |
638 | current->comm); | ||
637 | strcpy(cmd, current->comm); | 639 | strcpy(cmd, current->comm); |
638 | } | 640 | } |
639 | } | 641 | } |