From: Alex Elder Date: Thu, 23 May 2013 01:54:25 +0000 (-0500) Subject: rbd: flush dcache after zeroing page data X-Git-Tag: next-20130617~100^2~19 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=51ab1a67e08e0e4eefe80a10ae3507dfbf7894c6;p=karo-tx-linux.git rbd: flush dcache after zeroing page data Neither zero_bio_chain() nor zero_pages() contains a call to flush caches after zeroing a portion of a page. This can cause problems on architectures that have caches that allow virtual address aliasing. This resolves: http://tracker.ceph.com/issues/4777 Signed-off-by: Alex Elder Reviewed-by: Josh Durgin --- diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index c9486c8913d5..e975b36e1fea 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -1128,6 +1128,7 @@ static void zero_bio_chain(struct bio *chain, int start_ofs) buf = bvec_kmap_irq(bv, &flags); memset(buf + remainder, 0, bv->bv_len - remainder); + flush_dcache_page(bv->bv_page); bvec_kunmap_irq(buf, &flags); } pos += bv->bv_len; @@ -1160,6 +1161,7 @@ static void zero_pages(struct page **pages, u64 offset, u64 end) local_irq_save(flags); kaddr = kmap_atomic(*page); memset(kaddr + page_offset, 0, length); + flush_dcache_page(*page); kunmap_atomic(kaddr); local_irq_restore(flags);