diff options
author | Stephen M. Cameron <scameron@beardog.cce.hp.com> | 2012-03-22 16:40:09 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2012-03-22 16:40:09 -0400 |
commit | bc67f63650fad6b3478d9ddfd5406d45a95987c9 (patch) | |
tree | 040a67806fb15a6a3d0d013b434dee8aa5c9e6b3 | |
parent | 395d287526bb60411ff37b19ad9dd38b58ba8732 (diff) |
cciss: Fix scsi tape io with more than 255 scatter gather elements
The total number of scatter gather elements in the CISS command
used by the scsi tape code was being cast to a u8, which can hold
at most 255 scatter gather elements. It should have been cast to
a u16. Without this patch the command gets rejected by the controller
since the total scatter gather count did not add up to the right
value resulting in an i/o error.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | drivers/block/cciss_scsi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c index f510a9c9a6fd..acda773b3720 100644 --- a/drivers/block/cciss_scsi.c +++ b/drivers/block/cciss_scsi.c | |||
@@ -1411,7 +1411,7 @@ static void cciss_scatter_gather(ctlr_info_t *h, CommandList_struct *c, | |||
1411 | /* track how many SG entries we are using */ | 1411 | /* track how many SG entries we are using */ |
1412 | if (request_nsgs > h->maxSG) | 1412 | if (request_nsgs > h->maxSG) |
1413 | h->maxSG = request_nsgs; | 1413 | h->maxSG = request_nsgs; |
1414 | c->Header.SGTotal = (__u8) request_nsgs + chained; | 1414 | c->Header.SGTotal = (u16) request_nsgs + chained; |
1415 | if (request_nsgs > h->max_cmd_sgentries) | 1415 | if (request_nsgs > h->max_cmd_sgentries) |
1416 | c->Header.SGList = h->max_cmd_sgentries; | 1416 | c->Header.SGList = h->max_cmd_sgentries; |
1417 | else | 1417 | else |