We should never see the end pointer in blk_rq_map_sg(), or that's a bug
in the driver. So it should be OK to just clear the end pointer always
in there, even if it's not the prettiest solution...
This just needs to be wrapped up in some scatterlist.h macro/function.
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index 61c2e39..a3bda2f 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -1354,6 +1354,12 @@ new_segment:
else
sg = sg_next(sg);
+ /*
+ * Clear end-of-table pointer, we'll mark a new one
+ * at the end
+ */
+ sg->page_link &= ~0x2;
+
sg_dma_len(sg) = 0;
sg_dma_address(sg) = 0;
sg_set_page(sg, bvec->bv_page);
--
Jens Axboe
-