From: Tejun Heo Date: Tue, 19 Feb 2008 10:36:55 +0000 (+0100) Subject: block: clear drain buffer if draining for write command X-Git-Tag: v2.6.25-rc3~122^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=db0a2e0099be3a1cff55879225881465f16c67d3;p=platform%2Fkernel%2Flinux-3.10.git block: clear drain buffer if draining for write command Clear drain buffer before chaining if the command in question is a write. Signed-off-by: Tejun Heo Signed-off-by: Jens Axboe --- diff --git a/block/blk-merge.c b/block/blk-merge.c index bef1b4d..7506c4f 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c @@ -221,6 +221,9 @@ new_segment: } /* segments in rq */ if (q->dma_drain_size && q->dma_drain_needed(rq)) { + if (rq->cmd_flags & REQ_RW) + memset(q->dma_drain_buffer, 0, q->dma_drain_size); + sg->page_link &= ~0x02; sg = sg_next(sg); sg_set_page(sg, virt_to_page(q->dma_drain_buffer),