Commit 0eeaad0c authored by James Bottomley's avatar James Bottomley

SCSI sg,st block layer TCQ fix

Usually, the mid layer ends the block tag (if one was in use)
early to release the resources.  However, things like sg and st
don't go through the code path that does the release, so put a
fallback release in __scsi_release_request() for them.
parent 509f7e2b
...@@ -142,6 +142,21 @@ struct scsi_request *scsi_allocate_request(struct scsi_device *sdev, ...@@ -142,6 +142,21 @@ struct scsi_request *scsi_allocate_request(struct scsi_device *sdev,
void __scsi_release_request(struct scsi_request *sreq) void __scsi_release_request(struct scsi_request *sreq)
{ {
struct request *req = sreq->sr_request;
/* unlikely because the tag was usually ended earlier by the
* mid-layer. However, for layering reasons ULD's don't end
* the tag of commands they generate. */
if (unlikely(blk_rq_tagged(req))) {
unsigned long flags;
struct request_queue *q = req->q;
spin_lock_irqsave(q->queue_lock, flags);
blk_queue_end_tag(q, req);
spin_unlock_irqrestore(q->queue_lock, flags);
}
if (likely(sreq->sr_command != NULL)) { if (likely(sreq->sr_command != NULL)) {
struct scsi_cmnd *cmd = sreq->sr_command; struct scsi_cmnd *cmd = sreq->sr_command;
......
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