Skip to content

Commit c2572f2

Browse files
Nick PigginJens Axboe
authored andcommitted
brd: fix cacheflushing
brd is missing a flush_dcache_page. On 2nd thoughts, perhaps it is the pagecache's responsibility to flush user virtual aliases (the driver of course should flush kernel virtual mappings)... but anyway, there already exists cache flushing for one direction of transfer, so we should add the other. Signed-off-by: Nick Piggin <npiggin@suse.de> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
1 parent dfbc475 commit c2572f2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎drivers/block/brd.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,10 @@ static int brd_do_bvec(struct brd_device *brd, struct page *page,
275275
if (rw == READ) {
276276
copy_from_brd(mem + off, brd, sector, len);
277277
flush_dcache_page(page);
278-
} else
278+
} else {
279+
flush_dcache_page(page);
279280
copy_to_brd(brd, mem + off, sector, len);
281+
}
280282
kunmap_atomic(mem, KM_USER0);
281283

282284
out:

0 commit comments

Comments
 (0)