Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0874ee76bcd06e2f53c32a56773ad82f5920f0f9 Commit: 0874ee76bcd06e2f53c32a56773ad82f5920f0f9 Parent: f1346372f9c73154727bf2cadb7f78126597efd2 Author: FUJITA Tomonori <[EMAIL PROTECTED]> AuthorDate: Sat Aug 18 18:27:36 2007 +0900 Committer: Jens Axboe <[EMAIL PROTECTED]> CommitDate: Tue Oct 16 11:21:01 2007 +0200
libata sg chaining support fix Signed-off-by: FUJITA Tomonori <[EMAIL PROTECTED]> Signed-off-by: Jens Axboe <[EMAIL PROTECTED]> --- drivers/ata/libata-core.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index e52c331..bbaa545 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -4952,16 +4952,18 @@ static void __atapi_pio_bytes(struct ata_queued_cmd *qc, unsigned int bytes) { int do_write = (qc->tf.flags & ATA_TFLAG_WRITE); struct scatterlist *sg = qc->__sg; + struct scatterlist *lsg = sg_last(qc->__sg, qc->n_elem); struct ata_port *ap = qc->ap; struct page *page; unsigned char *buf; unsigned int offset, count; + int no_more_sg = 0; if (qc->curbytes + bytes >= qc->nbytes) ap->hsm_task_state = HSM_ST_LAST; next_sg: - if (unlikely(qc->cursg == sg_last(qc->__sg, qc->n_elem))) { + if (unlikely(no_more_sg)) { /* * The end of qc->sg is reached and the device expects * more data to transfer. In order not to overrun qc->sg @@ -5023,6 +5025,9 @@ next_sg: qc->cursg_ofs += count; if (qc->cursg_ofs == sg->length) { + if (qc->cursg == lsg) + no_more_sg = 1; + qc->cursg = sg_next(qc->cursg); qc->cursg_ofs = 0; } - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html