summaryrefslogtreecommitdiff
path: root/drivers/block/brd.c
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2009-04-15 12:32:07 +0400
committerJens Axboe <jens.axboe@oracle.com>2009-04-15 14:10:13 +0400
commitc2572f2b4ffc27ba79211aceee3bef53a59bb5cd (patch)
tree8c6680ad7778659c447c2a60b8565490b0d6f427 /drivers/block/brd.c
parentdfbc4752eab33e66f113f9daa2effbe241cd661d (diff)
downloadlinux-c2572f2b4ffc27ba79211aceee3bef53a59bb5cd.tar.xz
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>
Diffstat (limited to 'drivers/block/brd.c')
-rw-r--r--drivers/block/brd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/block/brd.c b/drivers/block/brd.c
index ee8ed68f197e..5f7e64ba87e5 100644
--- a/drivers/block/brd.c
+++ b/drivers/block/brd.c
@@ -275,8 +275,10 @@ static int brd_do_bvec(struct brd_device *brd, struct page *page,
if (rw == READ) {
copy_from_brd(mem + off, brd, sector, len);
flush_dcache_page(page);
- } else
+ } else {
+ flush_dcache_page(page);
copy_to_brd(brd, mem + off, sector, len);
+ }
kunmap_atomic(mem, KM_USER0);
out: