Skip to contentSkip to conversation

brd: fix cacheflushing

PATCH New Nick Piggin 1 participant 1 message Apr 15, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/block/brd.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/block/brd.c +3 -1
Index: linux-2.6/drivers/block/brd.c
===================================================================
@@ -275,8 +275,10 @@ static int brd_do_bvec(struct brd_device
 	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: