提交 db0a2e00 编写于 作者: T Tejun Heo 提交者: Jens Axboe

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: NTejun Heo <htejun@gmail.com>
Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
上级 2fb98e84
......@@ -221,6 +221,9 @@ int blk_rq_map_sg(struct request_queue *q, struct request *rq,
} /* 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),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册