All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rbd: flush dcache after zeroing page data
@ 2013-05-23 12:11 Alex Elder
  2013-05-23 12:13 ` Alex Elder
  2013-05-23 18:54 ` Josh Durgin
  0 siblings, 2 replies; 3+ messages in thread
From: Alex Elder @ 2013-05-23 12:11 UTC (permalink / raw)
  To: ceph-devel

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 <elder@inktank.com>
---
 drivers/block/rbd.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 6e377a0..f860dd6 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -1124,6 +1124,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;
@@ -1156,6 +1157,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);

-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-05-23 18:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-23 12:11 [PATCH] rbd: flush dcache after zeroing page data Alex Elder
2013-05-23 12:13 ` Alex Elder
2013-05-23 18:54 ` Josh Durgin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.