aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r--drivers/scsi/scsi_lib.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 1646fe7cbd4b..b8de389636f8 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -85,7 +85,7 @@ static void scsi_unprep_request(struct request *req)
85{ 85{
86 struct scsi_cmnd *cmd = req->special; 86 struct scsi_cmnd *cmd = req->special;
87 87
88 req->cmd_flags &= ~REQ_DONTPREP; 88 blk_unprep_request(req);
89 req->special = NULL; 89 req->special = NULL;
90 90
91 scsi_put_command(cmd); 91 scsi_put_command(cmd);
@@ -722,7 +722,7 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
722 sense_deferred = scsi_sense_is_deferred(&sshdr); 722 sense_deferred = scsi_sense_is_deferred(&sshdr);
723 } 723 }
724 724
725 if (blk_pc_request(req)) { /* SG_IO ioctl from block level */ 725 if (req->cmd_type == REQ_TYPE_BLOCK_PC) { /* SG_IO ioctl from block level */
726 req->errors = result; 726 req->errors = result;
727 if (result) { 727 if (result) {
728 if (sense_valid && req->sense) { 728 if (sense_valid && req->sense) {
@@ -757,7 +757,8 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
757 } 757 }
758 } 758 }
759 759
760 BUG_ON(blk_bidi_rq(req)); /* bidi not support for !blk_pc_request yet */ 760 /* no bidi support for !REQ_TYPE_BLOCK_PC yet */
761 BUG_ON(blk_bidi_rq(req));
761 762
762 /* 763 /*
763 * Next deal with any sectors which we were able to correctly 764 * Next deal with any sectors which we were able to correctly
@@ -1010,11 +1011,8 @@ int scsi_init_io(struct scsi_cmnd *cmd, gfp_t gfp_mask)
1010 1011
1011err_exit: 1012err_exit:
1012 scsi_release_buffers(cmd); 1013 scsi_release_buffers(cmd);
1013 if (error == BLKPREP_KILL) 1014 scsi_put_command(cmd);
1014 scsi_put_command(cmd); 1015 cmd->request->special = NULL;
1015 else /* BLKPREP_DEFER */
1016 scsi_unprep_request(cmd->request);
1017
1018 return error; 1016 return error;
1019} 1017}
1020EXPORT_SYMBOL(scsi_init_io); 1018EXPORT_SYMBOL(scsi_init_io);