rbd: flush dcache after zeroing page data
Subsystems (2)
PATCH 1/1 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
--- drivers/block/rbd.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/block/rbd.c +0 -0
@@ -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);
Signature · 1 line
1.7.9.5
Quoted 9 lines · Alex Elder
Neither
zero_bio_chain()norzero_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/4777Signed-off-by Alex Elder <[email protected]>
This patch and the other two I just posted are available in the "review/wip-rbd" branch of the ceph-client git repository.
-Alex
Quoted 35 lines · Alex Elder
Neither
zero_bio_chain()norzero_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/4777Signed-off-by Alex Elder <[email protected]>--- drivers/block/rbd.c | 2 ++ 1 file changed, 2 insertions(+)drivers/block/rbd.c +1
-0@@ -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;drivers/block/rbd.c +1
-0@@ -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);