aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sr.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/sr.c')
-rw-r--r--drivers/scsi/sr.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index 2de44cc58b1a..8bd54a64efd6 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -88,9 +88,9 @@ static struct dev_pm_ops sr_pm_ops = {
88}; 88};
89 89
90static struct scsi_driver sr_template = { 90static struct scsi_driver sr_template = {
91 .owner = THIS_MODULE,
92 .gendrv = { 91 .gendrv = {
93 .name = "sr", 92 .name = "sr",
93 .owner = THIS_MODULE,
94 .probe = sr_probe, 94 .probe = sr_probe,
95 .remove = sr_remove, 95 .remove = sr_remove,
96 .pm = &sr_pm_ops, 96 .pm = &sr_pm_ops,
@@ -387,7 +387,7 @@ static int sr_init_command(struct scsi_cmnd *SCpnt)
387 struct request *rq = SCpnt->request; 387 struct request *rq = SCpnt->request;
388 int ret; 388 int ret;
389 389
390 ret = scsi_init_io(SCpnt, GFP_ATOMIC); 390 ret = scsi_init_io(SCpnt);
391 if (ret != BLKPREP_OK) 391 if (ret != BLKPREP_OK)
392 goto out; 392 goto out;
393 SCpnt = rq->special; 393 SCpnt = rq->special;
@@ -549,6 +549,11 @@ static int sr_block_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd,
549 549
550 mutex_lock(&sr_mutex); 550 mutex_lock(&sr_mutex);
551 551
552 ret = scsi_ioctl_block_when_processing_errors(sdev, cmd,
553 (mode & FMODE_NDELAY) != 0);
554 if (ret)
555 goto out;
556
552 /* 557 /*
553 * Send SCSI addressing ioctls directly to mid level, send other 558 * Send SCSI addressing ioctls directly to mid level, send other
554 * ioctls to cdrom/block level. 559 * ioctls to cdrom/block level.
@@ -564,16 +569,6 @@ static int sr_block_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd,
564 if (ret != -ENOSYS) 569 if (ret != -ENOSYS)
565 goto out; 570 goto out;
566 571
567 /*
568 * ENODEV means that we didn't recognise the ioctl, or that we
569 * cannot execute it in the current device state. In either
570 * case fall through to scsi_ioctl, which will return ENDOEV again
571 * if it doesn't recognise the ioctl
572 */
573 ret = scsi_nonblockable_ioctl(sdev, cmd, argp,
574 (mode & FMODE_NDELAY) != 0);
575 if (ret != -ENODEV)
576 goto out;
577 ret = scsi_ioctl(sdev, cmd, argp); 572 ret = scsi_ioctl(sdev, cmd, argp);
578 573
579out: 574out: