Skip to content

Commit

Permalink
[SCSI] scsi_transport_fc: Make sure commands are completed when rport…
Browse files Browse the repository at this point in the history
… is offline

blk_end_request doesn't complete a bidi request
successfully

The unfinished request eventually triggers a panic in
timeout handling routine fc_bsg_job_timeout as
req->special is NULL

Use blk_end_request_all to end the request unconditionally

Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
Acked-by: James Smart  <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
  • Loading branch information
Sarang Radke authored and James Bottomley committed Mar 27, 2010
1 parent 4ae0a6c commit d88a714
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/scsi/scsi_transport_fc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3852,7 +3852,7 @@ fc_bsg_request_handler(struct request_queue *q, struct Scsi_Host *shost,
if (rport && (rport->port_state != FC_PORTSTATE_ONLINE)) {
req->errors = -ENXIO;
spin_unlock_irq(q->queue_lock);
blk_end_request(req, -ENXIO, blk_rq_bytes(req));
blk_end_request_all(req, -ENXIO);
spin_lock_irq(q->queue_lock);
continue;
}
Expand All @@ -3862,7 +3862,7 @@ fc_bsg_request_handler(struct request_queue *q, struct Scsi_Host *shost,
ret = fc_req_to_bsgjob(shost, rport, req);
if (ret) {
req->errors = ret;
blk_end_request(req, ret, blk_rq_bytes(req));
blk_end_request_all(req, ret);
spin_lock_irq(q->queue_lock);
continue;
}
Expand Down

0 comments on commit d88a714

Please sign in to comment.