aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/cciss_scsi.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2006-06-03 07:21:13 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-06-06 11:07:25 -0400
commit5d5ff44fe6775ccb922fd1f7d478b2ba9ca95068 (patch)
treed8569caefe1cb5ecced30929ef98d3e1fe642425 /drivers/block/cciss_scsi.c
parente4a082c7c1f9a7b11fece6918e7ee5519b39ac46 (diff)
[SCSI] fix up request buffer reference in various scsi drivers
Various scsi drivers use scsi_cmnd.buffer and scsi_cmnd.bufflen in their queuecommand functions. Those fields are internal storage for the midlayer only and are used to restore the original payload after request_buffer and request_bufflen have been overwritten for EH. Using the buffer and bufflen fields means they do very broken things in error handling. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/block/cciss_scsi.c')
-rw-r--r--drivers/block/cciss_scsi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c
index 597c007fe81b..afdff32f6724 100644
--- a/drivers/block/cciss_scsi.c
+++ b/drivers/block/cciss_scsi.c
@@ -578,7 +578,7 @@ complete_scsi_command( CommandList_struct *cp, int timeout, __u32 tag)
578 578
579 if (cmd->use_sg) { 579 if (cmd->use_sg) {
580 pci_unmap_sg(ctlr->pdev, 580 pci_unmap_sg(ctlr->pdev,
581 cmd->buffer, cmd->use_sg, 581 cmd->request_buffer, cmd->use_sg,
582 cmd->sc_data_direction); 582 cmd->sc_data_direction);
583 } 583 }
584 else if (cmd->request_bufflen) { 584 else if (cmd->request_bufflen) {
@@ -1210,7 +1210,7 @@ cciss_scatter_gather(struct pci_dev *pdev,
1210 struct scsi_cmnd *cmd) 1210 struct scsi_cmnd *cmd)
1211{ 1211{
1212 unsigned int use_sg, nsegs=0, len; 1212 unsigned int use_sg, nsegs=0, len;
1213 struct scatterlist *scatter = (struct scatterlist *) cmd->buffer; 1213 struct scatterlist *scatter = (struct scatterlist *) cmd->request_buffer;
1214 __u64 addr64; 1214 __u64 addr64;
1215 1215
1216 /* is it just one virtual address? */ 1216 /* is it just one virtual address? */
@@ -1232,7 +1232,7 @@ cciss_scatter_gather(struct pci_dev *pdev,
1232 } /* else, must be a list of virtual addresses.... */ 1232 } /* else, must be a list of virtual addresses.... */
1233 else if (cmd->use_sg <= MAXSGENTRIES) { /* not too many addrs? */ 1233 else if (cmd->use_sg <= MAXSGENTRIES) { /* not too many addrs? */
1234 1234
1235 use_sg = pci_map_sg(pdev, cmd->buffer, cmd->use_sg, 1235 use_sg = pci_map_sg(pdev, cmd->request_buffer, cmd->use_sg,
1236 cmd->sc_data_direction); 1236 cmd->sc_data_direction);
1237 1237
1238 for (nsegs=0; nsegs < use_sg; nsegs++) { 1238 for (nsegs=0; nsegs < use_sg; nsegs++) {