projects/linux·commit 98fb1ffd

UBI: block: Add missing cache flushes

98fb1ffd · Kevin Cernekee <[email protected]> · 2015-04-22 09:30:53 -03:00

Block drivers are responsible for calling flush_dcache_page() on each
BIO request. This operation keeps the I$ coherent with the D$ on
architectures that don't have hardware coherency support. Without this
flush, random crashes are seen when executing user programs from an ext4
filesystem backed by a ubiblock device.

This patch is based on the change implemented in commit 2d4dc890b5c8
("block: add helpers to run flush_dcache_page() against a bio and a
request's pages").

Fixes: 9d54c8a33eec ("UBI: R/O block driver on top of UBI volumes")
Signed-off-by: Kevin Cernekee <[email protected]>
Signed-off-by: Ezequiel Garcia <[email protected]>
Signed-off-by: Richard Weinberger <[email protected]>
Commit
98fb1ffd8154890d7051750e61ff5548c3ee2ab2
Parents
5ebe6afa

Changes

1 files changed · +2 −0

FileStatusAddDelContent
drivers/mtd/ubi/block.cmodified+2−0View file

drivers/mtd/ubi/block.c

View file
diff --git a/drivers/mtd/ubi/block.c b/drivers/mtd/ubi/block.c
index db2c05b..c9eb78f 100644
--- a/drivers/mtd/ubi/block.c
+++ b/drivers/mtd/ubi/block.c
@@ -310,6 +310,8 @@ static void ubiblock_do_work(struct work_struct *work)
blk_rq_map_sg(req->q, req, pdu->usgl.sg);
ret = ubiblock_read(pdu);
+ rq_flush_dcache_pages(req);
+
blk_mq_end_request(req, ret);
}