Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 316793
b: refs/heads/master
c: 940f5d4
h: refs/heads/master
i:
  316791: 589f4c0
v: v3
  • Loading branch information
Bart Van Assche authored and James Bottomley committed Jul 20, 2012
1 parent e2e74e7 commit dde40a0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 67bd94130015c507011af37858989b199c52e1de
refs/heads/master: 940f5d47e2f2e1fa00443921a0abf4822335b54d
11 changes: 11 additions & 0 deletions trunk/drivers/scsi/scsi_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,15 +479,26 @@ void scsi_requeue_run_queue(struct work_struct *work)
*/
static void scsi_requeue_command(struct request_queue *q, struct scsi_cmnd *cmd)
{
struct scsi_device *sdev = cmd->device;
struct request *req = cmd->request;
unsigned long flags;

/*
* We need to hold a reference on the device to avoid the queue being
* killed after the unlock and before scsi_run_queue is invoked which
* may happen because scsi_unprep_request() puts the command which
* releases its reference on the device.
*/
get_device(&sdev->sdev_gendev);

spin_lock_irqsave(q->queue_lock, flags);
scsi_unprep_request(req);
blk_requeue_request(q, req);
spin_unlock_irqrestore(q->queue_lock, flags);

scsi_run_queue(q);

put_device(&sdev->sdev_gendev);
}

void scsi_next_command(struct scsi_cmnd *cmd)
Expand Down

0 comments on commit dde40a0

Please sign in to comment.