Commit 6d9e5ab3 authored by Patrick Mansfield's avatar Patrick Mansfield Committed by James Bottomley

[PATCH] fix badness in scsi_single_lun_run

This patch against recent mainline bk removes the bogus WARN_ON for
single_lun devices, and a meaningless comment.

We clear the starget_sdev_user, and immediately blk_run_queue for the LUN
that just issued IO. Another LUN could race in scsi_request_fn, but it is
most likely that the last user will get there first, and reset
starget_sdev_user. If it does not, it will have to wait for the other LUN
to finish all of its IO.
parent c35045c6
......@@ -340,7 +340,6 @@ static void scsi_single_lun_run(struct scsi_device *current_sdev)
unsigned long flags;
spin_lock_irqsave(shost->host_lock, flags);
WARN_ON(!current_sdev->sdev_target->starget_sdev_user);
current_sdev->sdev_target->starget_sdev_user = NULL;
spin_unlock_irqrestore(shost->host_lock, flags);
......@@ -352,10 +351,6 @@ static void scsi_single_lun_run(struct scsi_device *current_sdev)
*/
blk_run_queue(current_sdev->request_queue);
/*
* After unlock, this races with anyone clearing starget_sdev_user,
* but we always enter this function again, avoiding any problems.
*/
spin_lock_irqsave(shost->host_lock, flags);
if (current_sdev->sdev_target->starget_sdev_user)
goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment