Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Nick Piggin and committed by
Jens Axboe
c2572f2b dfbc4752

+3 -1
+3 -1
drivers/block/brd.c
··· 275 275 if (rw == READ) { 276 276 copy_from_brd(mem + off, brd, sector, len); 277 277 flush_dcache_page(page); 278 - } else 278 + } else { 279 + flush_dcache_page(page); 279 280 copy_to_brd(brd, mem + off, sector, len); 281 + } 280 282 kunmap_atomic(mem, KM_USER0); 281 283 282 284 out: