aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sg.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/sg.c')
-rw-r--r--drivers/scsi/sg.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index f1871ea04045..e65f5d432662 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -602,8 +602,9 @@ sg_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos)
602 * but is is possible that the app intended SG_DXFER_TO_DEV, because there 602 * but is is possible that the app intended SG_DXFER_TO_DEV, because there
603 * is a non-zero input_size, so emit a warning. 603 * is a non-zero input_size, so emit a warning.
604 */ 604 */
605 if (hp->dxfer_direction == SG_DXFER_TO_FROM_DEV) 605 if (hp->dxfer_direction == SG_DXFER_TO_FROM_DEV) {
606 if (printk_ratelimit()) 606 static char cmd[TASK_COMM_LEN];
607 if (strcmp(current->comm, cmd) && printk_ratelimit()) {
607 printk(KERN_WARNING 608 printk(KERN_WARNING
608 "sg_write: data in/out %d/%d bytes for SCSI command 0x%x--" 609 "sg_write: data in/out %d/%d bytes for SCSI command 0x%x--"
609 "guessing data in;\n" KERN_WARNING " " 610 "guessing data in;\n" KERN_WARNING " "
@@ -611,6 +612,9 @@ sg_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos)
611 old_hdr.reply_len - (int)SZ_SG_HEADER, 612 old_hdr.reply_len - (int)SZ_SG_HEADER,
612 input_size, (unsigned int) cmnd[0], 613 input_size, (unsigned int) cmnd[0],
613 current->comm); 614 current->comm);
615 strcpy(cmd, current->comm);
616 }
617 }
614 k = sg_common_write(sfp, srp, cmnd, sfp->timeout, blocking); 618 k = sg_common_write(sfp, srp, cmnd, sfp->timeout, blocking);
615 return (k < 0) ? k : count; 619 return (k < 0) ? k : count;
616} 620}