aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_lib.c
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2005-11-11 06:31:40 -0500
committerJames Bottomley <jejb@mulgrave.(none)>2005-12-14 22:08:16 -0500
commit0d95716d6a1308c465d8c17ed1a217628936bb0c (patch)
treebf304209ec749fee1b7c66e000874bca973d2ec9 /drivers/scsi/scsi_lib.c
parent17e01f216b611fc46956dcd9063aec4de75991e3 (diff)
[SCSI] complete the whole command when it is REQ_BLOCK_PC
sd does not allow scsi_io_completion to retry commands for SG_IO requests, and it make sense that it should not happen for st SG_IO commands too. If for st we hit the bottom of scsi_io_completion we will probably screw things up pretty bad. This patch returns to the block layer that the whole command completed and relies on the caller to check the request errors field. For initialization commands like in sd, this adds the previous behavior where scsi_io_completion did not process the error. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r--drivers/scsi/scsi_lib.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 365843a1561f..3e136bfe4219 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1247,7 +1247,13 @@ static int scsi_issue_flush_fn(request_queue_t *q, struct gendisk *disk,
1247static void scsi_generic_done(struct scsi_cmnd *cmd) 1247static void scsi_generic_done(struct scsi_cmnd *cmd)
1248{ 1248{
1249 BUG_ON(!blk_pc_request(cmd->request)); 1249 BUG_ON(!blk_pc_request(cmd->request));
1250 scsi_io_completion(cmd, cmd->result == 0 ? cmd->bufflen : 0, 0); 1250 /*
1251 * This will complete the whole command with uptodate=1 so
1252 * as far as the block layer is concerned the command completed
1253 * successfully. Since this is a REQ_BLOCK_PC command the
1254 * caller should check the request's errors value
1255 */
1256 scsi_io_completion(cmd, cmd->bufflen, 0);
1251} 1257}
1252 1258
1253static int scsi_prep_fn(struct request_queue *q, struct request *req) 1259static int scsi_prep_fn(struct request_queue *q, struct request *req)