diff options
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r-- | drivers/scsi/scsi_lib.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 3d16c70fbde0..ee308f6f7982 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -546,7 +546,7 @@ static struct scsi_cmnd *scsi_end_request(struct scsi_cmnd *cmd, int error, | |||
546 | * to queue the remainder of them. | 546 | * to queue the remainder of them. |
547 | */ | 547 | */ |
548 | if (blk_end_request(req, error, bytes)) { | 548 | if (blk_end_request(req, error, bytes)) { |
549 | int leftover = blk_rq_sectors(req) << 9; | 549 | int leftover = blk_rq_bytes(req); |
550 | 550 | ||
551 | if (blk_pc_request(req)) | 551 | if (blk_pc_request(req)) |
552 | leftover = req->resid_len; | 552 | leftover = req->resid_len; |
@@ -964,10 +964,7 @@ static int scsi_init_sgtable(struct request *req, struct scsi_data_buffer *sdb, | |||
964 | count = blk_rq_map_sg(req->q, req, sdb->table.sgl); | 964 | count = blk_rq_map_sg(req->q, req, sdb->table.sgl); |
965 | BUG_ON(count > sdb->table.nents); | 965 | BUG_ON(count > sdb->table.nents); |
966 | sdb->table.nents = count; | 966 | sdb->table.nents = count; |
967 | if (blk_pc_request(req)) | 967 | sdb->length = blk_rq_bytes(req); |
968 | sdb->length = blk_rq_bytes(req); | ||
969 | else | ||
970 | sdb->length = blk_rq_sectors(req) << 9; | ||
971 | return BLKPREP_OK; | 968 | return BLKPREP_OK; |
972 | } | 969 | } |
973 | 970 | ||