Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

aoe: prevent cache aliases

Prevent the AoE block driver from creating cache aliases of page cache
pages on machines with virtually indexed caches.

Building kernels on an AT91SAM9G20 board without this patch fails with
segmentation faults after a couple of passes.

Signed-off-by: Peter Horton <zero@colonel-panic.org>
Cc: "Ed L. Cashin" <ecashin@coraid.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Peter Horton and committed by
Linus Torvalds
0a1f127a ca029701

+21 -2
+21 -2
drivers/block/aoe/aoecmd.c
··· 735 735 part_stat_unlock(); 736 736 } 737 737 738 + /* 739 + * Ensure we don't create aliases in VI caches 740 + */ 741 + static inline void 742 + killalias(struct bio *bio) 743 + { 744 + struct bio_vec *bv; 745 + int i; 746 + 747 + if (bio_data_dir(bio) == READ) 748 + __bio_for_each_segment(bv, bio, i, 0) { 749 + flush_dcache_page(bv->bv_page); 750 + } 751 + } 752 + 738 753 void 739 754 aoecmd_ata_rsp(struct sk_buff *skb) 740 755 { ··· 868 853 869 854 if (buf && --buf->nframesout == 0 && buf->resid == 0) { 870 855 diskstats(d->gd, buf->bio, jiffies - buf->stime, buf->sector); 871 - n = (buf->flags & BUFFL_FAIL) ? -EIO : 0; 872 - bio_endio(buf->bio, n); 856 + if (buf->flags & BUFFL_FAIL) 857 + bio_endio(buf->bio, -EIO); 858 + else { 859 + killalias(buf->bio); 860 + bio_endio(buf->bio, 0); 861 + } 873 862 mempool_free(buf, d->bufpool); 874 863 } 875 864