From 7328cb4feff36c03159241716caa5b72e18ead66 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 23 Oct 2007 09:49:25 +0200 Subject: [PATCH] --- yaml --- r: 72185 b: refs/heads/master c: 7aeacf982203fb4dea2f3434eefdc268cfd5d6d9 h: refs/heads/master i: 72183: 4e9a3e2f3cd8374a265fb8dc5db19ac181190f65 v: v3 --- [refs] | 2 +- trunk/block/ll_rw_blk.c | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 1a3f6a110eb7..2cf9956d8b72 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ad0d4083e65d9f223275adbfb9a7927e2120dc6c +refs/heads/master: 7aeacf982203fb4dea2f3434eefdc268cfd5d6d9 diff --git a/trunk/block/ll_rw_blk.c b/trunk/block/ll_rw_blk.c index fb8fb8852c3b..de5ba479c224 100644 --- a/trunk/block/ll_rw_blk.c +++ b/trunk/block/ll_rw_blk.c @@ -1351,8 +1351,20 @@ int blk_rq_map_sg(struct request_queue *q, struct request *rq, new_segment: if (!sg) sg = sglist; - else + else { + /* + * If the driver previously mapped a shorter + * list, we could see a termination bit + * prematurely unless it fully inits the sg + * table on each mapping. We KNOW that there + * must be more entries here or the driver + * would be buggy, so force clear the + * termination bit to avoid doing a full + * sg_init_table() in drivers for each command. + */ + sg->page_link &= ~0x02; sg = sg_next(sg); + } sg_set_page(sg, bvec->bv_page); sg->length = nbytes;