]> git.hungrycats.org Git - linux/commitdiff
SCSI sg,st block layer TCQ fix
authorJames Bottomley <jejb@mulgrave.(none)>
Sat, 10 Jan 2004 10:37:47 +0000 (05:37 -0500)
committerJames Bottomley <jejb@mulgrave.(none)>
Sat, 10 Jan 2004 10:37:47 +0000 (05:37 -0500)
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.

drivers/scsi/scsi.c

index 2e47da56a08e70e8c1cb8427af07ee722eae4fb3..81d123ce6486472bbd86172633d322150e0a4c72 100644 (file)
@@ -142,6 +142,21 @@ struct scsi_request *scsi_allocate_request(struct scsi_device *sdev,
 
 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)) {
                struct scsi_cmnd *cmd = sreq->sr_command;