From: Nick Piggin Date: Wed, 15 Apr 2009 08:32:07 +0000 (+0200) Subject: brd: fix cacheflushing X-Git-Tag: v2.6.30-rc3~88^2~4 X-Git-Url: http://ftp.safe.ca/?p=safe%2Fjmp%2Flinux-2.6;a=commitdiff_plain;h=c2572f2b4ffc27ba79211aceee3bef53a59bb5cd 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 Signed-off-by: Jens Axboe --- diff --git a/drivers/block/brd.c b/drivers/block/brd.c index ee8ed68..5f7e64b 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: