Skip to content

Commit

Permalink
Revert revert of "[SCSI] fix usb storage oops"
Browse files Browse the repository at this point in the history
This reverts commit 1b0997f, which in
turn reverted 34ea80e (which is thus
re-instated).

Quoth James Bottomley:

  "All it's doing is deferring the device_put() from the
   scsi_put_command() to after the scsi_run_queue(), which doesn't fix
   the sleep while atomic problem of the device release method.  In both
   cases we still get the semaphore in atomic context problem which is
   caused by scsi_reap_target() doing a device_del(), which I assumed
   (wrongly) was valid from atomic context."

who also promised to fix scsi_reap_target().

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Linus Torvalds committed Dec 12, 2005
1 parent 5036805 commit 49d7bc6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/scsi/scsi_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,10 +542,17 @@ static void scsi_requeue_command(struct request_queue *q, struct scsi_cmnd *cmd)

void scsi_next_command(struct scsi_cmnd *cmd)
{
struct request_queue *q = cmd->device->request_queue;
struct scsi_device *sdev = cmd->device;
struct request_queue *q = sdev->request_queue;

/* need to hold a reference on the device before we let go of the cmd */
get_device(&sdev->sdev_gendev);

scsi_put_command(cmd);
scsi_run_queue(q);

/* ok to remove device now */
put_device(&sdev->sdev_gendev);
}

void scsi_run_host_queues(struct Scsi_Host *shost)
Expand Down

0 comments on commit 49d7bc6

Please sign in to comment.