From: Andrew Morton Signed-off-by: Andrew Morton --- drivers/scsi/hosts.c | 1 + drivers/scsi/ide-scsi.c | 13 +------------ drivers/scsi/scsi_lib.c | 9 +++++---- drivers/scsi/sd.c | 1 - 4 files changed, 7 insertions(+), 17 deletions(-) diff -puN drivers/scsi/scsi_lib.c~git-block-fixup drivers/scsi/scsi_lib.c --- a/drivers/scsi/scsi_lib.c~git-block-fixup +++ a/drivers/scsi/scsi_lib.c @@ -294,13 +294,14 @@ static int scsi_req_map_sg(struct reques int nr_pages = (bufflen + sgl[0].offset + PAGE_SIZE - 1) >> PAGE_SHIFT; unsigned int data_len = bufflen, len, bytes, off; struct page *page; + struct scatterlist *sg; struct bio *bio = NULL; int i, err, nr_vecs = 0; - for (i = 0; i < nsegs; i++) { - page = sgl[i].page; - off = sgl[i].offset; - len = sgl[i].length; + for_each_sg(sgl, sg, nsegs, i) { + page = sg->page; + off = sg->offset; + len = sg->length; while (len > 0 && data_len > 0) { /* diff -puN drivers/scsi/hosts.c~git-block-fixup drivers/scsi/hosts.c --- a/drivers/scsi/hosts.c~git-block-fixup +++ a/drivers/scsi/hosts.c @@ -343,6 +343,7 @@ struct Scsi_Host *scsi_host_alloc(struct shost->use_clustering = sht->use_clustering; shost->ordered_tag = sht->ordered_tag; shost->active_mode = sht->supported_mode; + shost->use_sg_chaining = sht->use_sg_chaining; if (sht->max_host_blocked) shost->max_host_blocked = sht->max_host_blocked; diff -puN drivers/infiniband/ulp/iser/iser_memory.c~git-block-fixup drivers/infiniband/ulp/iser/iser_memory.c diff -puN drivers/scsi/sd.c~git-block-fixup drivers/scsi/sd.c --- a/drivers/scsi/sd.c~git-block-fixup +++ a/drivers/scsi/sd.c @@ -1674,7 +1674,6 @@ static int sd_probe(struct device *dev) sd_revalidate_disk(gd); blk_queue_prep_rq(sdp->request_queue, sd_prep_fn); - blk_queue_issue_flush_fn(sdp->request_queue, sd_issue_flush); gd->driverfs_dev = &sdp->sdev_gendev; gd->flags = GENHD_FL_DRIVERFS; diff -puN drivers/scsi/ide-scsi.c~git-block-fixup drivers/scsi/ide-scsi.c --- a/drivers/scsi/ide-scsi.c~git-block-fixup +++ a/drivers/scsi/ide-scsi.c @@ -174,12 +174,6 @@ static void idescsi_input_buffers (ide_d char *buf; while (bcount) { - if (pc->sg - scsi_sglist(pc->scsi_cmd) > - scsi_sg_count(pc->scsi_cmd)) { - printk (KERN_ERR "ide-scsi: scatter gather table too small, discarding data\n"); - idescsi_discard_data (drive, bcount); - return; - } count = min(pc->sg->length - pc->b_count, bcount); if (PageHighMem(pc->sg->page)) { unsigned long flags; @@ -217,12 +211,6 @@ static void idescsi_output_buffers (ide_ char *buf; while (bcount) { - if (pc->sg - scsi_sglist(pc->scsi_cmd) > - scsi_sg_count(pc->scsi_cmd)) { - printk (KERN_ERR "ide-scsi: scatter gather table too small, padding with zeros\n"); - idescsi_output_zeros (drive, bcount); - return; - } count = min(pc->sg->length - pc->b_count, bcount); if (PageHighMem(pc->sg->page)) { unsigned long flags; @@ -819,6 +807,7 @@ static int idescsi_queue (struct scsi_cm memcpy (pc->c, cmd->cmnd, cmd->cmd_len); pc->buffer = NULL; pc->sg = scsi_sglist(cmd); + pc->last_sg = sg_last(pc->sg, cmd->use_sg); pc->b_count = 0; pc->request_transfer = pc->buffer_size = scsi_bufflen(cmd); pc->scsi_cmd = cmd; _