aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/bsg.c2
-rw-r--r--block/scsi_ioctl.c10
2 files changed, 6 insertions, 6 deletions
diff --git a/block/bsg.c b/block/bsg.c
index 2d36b127f384..e8bd2475682a 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -914,7 +914,7 @@ static long bsg_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
914 case SG_EMULATED_HOST: 914 case SG_EMULATED_HOST:
915 case SCSI_IOCTL_SEND_COMMAND: { 915 case SCSI_IOCTL_SEND_COMMAND: {
916 void __user *uarg = (void __user *) arg; 916 void __user *uarg = (void __user *) arg;
917 return scsi_cmd_ioctl(file, bd->queue, NULL, cmd, uarg); 917 return scsi_cmd_ioctl(bd->queue, NULL, file->f_mode, cmd, uarg);
918 } 918 }
919 case SG_IO: { 919 case SG_IO: {
920 struct request *rq; 920 struct request *rq;
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
index 375e25df8adc..5963cf91a3a0 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -517,8 +517,8 @@ static inline int blk_send_start_stop(struct request_queue *q,
517 return __blk_send_generic(q, bd_disk, GPCMD_START_STOP_UNIT, data); 517 return __blk_send_generic(q, bd_disk, GPCMD_START_STOP_UNIT, data);
518} 518}
519 519
520int scsi_cmd_ioctl(struct file *file, struct request_queue *q, 520int scsi_cmd_ioctl(struct request_queue *q, struct gendisk *bd_disk, fmode_t mode,
521 struct gendisk *bd_disk, unsigned int cmd, void __user *arg) 521 unsigned int cmd, void __user *arg)
522{ 522{
523 int err; 523 int err;
524 524
@@ -559,7 +559,7 @@ int scsi_cmd_ioctl(struct file *file, struct request_queue *q,
559 err = -EFAULT; 559 err = -EFAULT;
560 if (copy_from_user(&hdr, arg, sizeof(hdr))) 560 if (copy_from_user(&hdr, arg, sizeof(hdr)))
561 break; 561 break;
562 err = sg_io(q, bd_disk, &hdr, file ? file->f_mode : 0); 562 err = sg_io(q, bd_disk, &hdr, mode);
563 if (err == -EFAULT) 563 if (err == -EFAULT)
564 break; 564 break;
565 565
@@ -607,7 +607,7 @@ int scsi_cmd_ioctl(struct file *file, struct request_queue *q,
607 hdr.cmdp = ((struct cdrom_generic_command __user*) arg)->cmd; 607 hdr.cmdp = ((struct cdrom_generic_command __user*) arg)->cmd;
608 hdr.cmd_len = sizeof(cgc.cmd); 608 hdr.cmd_len = sizeof(cgc.cmd);
609 609
610 err = sg_io(q, bd_disk, &hdr, file ? file->f_mode : 0); 610 err = sg_io(q, bd_disk, &hdr, mode);
611 if (err == -EFAULT) 611 if (err == -EFAULT)
612 break; 612 break;
613 613
@@ -631,7 +631,7 @@ int scsi_cmd_ioctl(struct file *file, struct request_queue *q,
631 if (!arg) 631 if (!arg)
632 break; 632 break;
633 633
634 err = sg_scsi_ioctl(q, bd_disk, file ? file->f_mode : 0, arg); 634 err = sg_scsi_ioctl(q, bd_disk, mode, arg);
635 break; 635 break;
636 case CDROMCLOSETRAY: 636 case CDROMCLOSETRAY:
637 err = blk_send_start_stop(q, bd_disk, 0x03); 637 err = blk_send_start_stop(q, bd_disk, 0x03);