1
0
Fork 0

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 <htejun@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
hifive-unleashed-5.1
Tejun Heo 2008-02-19 11:36:55 +01:00 committed by Jens Axboe
parent 2fb98e8414
commit db0a2e0099
1 changed files with 3 additions and 0 deletions

View File

@ -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),