aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/scsi_lib.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index f9026d08532a..0c6924eecf59 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -140,14 +140,12 @@ static void scsi_unprep_request(struct request *req)
140 * commands. 140 * commands.
141 * Notes: This could be called either from an interrupt context or a 141 * Notes: This could be called either from an interrupt context or a
142 * normal process context. 142 * normal process context.
143 * Notes: Upon return, cmd is a stale pointer.
144 */ 143 */
145int scsi_queue_insert(struct scsi_cmnd *cmd, int reason) 144int scsi_queue_insert(struct scsi_cmnd *cmd, int reason)
146{ 145{
147 struct Scsi_Host *host = cmd->device->host; 146 struct Scsi_Host *host = cmd->device->host;
148 struct scsi_device *device = cmd->device; 147 struct scsi_device *device = cmd->device;
149 struct request_queue *q = device->request_queue; 148 struct request_queue *q = device->request_queue;
150 struct request *req = cmd->request;
151 unsigned long flags; 149 unsigned long flags;
152 150
153 SCSI_LOG_MLQUEUE(1, 151 SCSI_LOG_MLQUEUE(1,
@@ -188,9 +186,8 @@ int scsi_queue_insert(struct scsi_cmnd *cmd, int reason)
188 * function. The SCSI request function detects the blocked condition 186 * function. The SCSI request function detects the blocked condition
189 * and plugs the queue appropriately. 187 * and plugs the queue appropriately.
190 */ 188 */
191 scsi_unprep_request(req);
192 spin_lock_irqsave(q->queue_lock, flags); 189 spin_lock_irqsave(q->queue_lock, flags);
193 blk_requeue_request(q, req); 190 blk_requeue_request(q, cmd->request);
194 spin_unlock_irqrestore(q->queue_lock, flags); 191 spin_unlock_irqrestore(q->queue_lock, flags);
195 192
196 scsi_run_queue(q); 193 scsi_run_queue(q);