]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
UBI: block: Add missing cache flushes
authorKevin Cernekee <cernekee@chromium.org>
Wed, 22 Apr 2015 12:30:53 +0000 (09:30 -0300)
committerLuis Henriques <luis.henriques@canonical.com>
Wed, 30 Sep 2015 12:20:56 +0000 (13:20 +0100)
commit 98fb1ffd8154890d7051750e61ff5548c3ee2ab2 upstream.

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 <cernekee@chromium.org>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@imgtec.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
[ luis: backported to 3.16: used Kevin's backport to 3.14 ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
drivers/mtd/ubi/block.c

index 8457df7ec5afe548d29f6faaa4560dd5db6fb815..8b4a182d7cf9692288b23bebfc62cfcc97927686 100644 (file)
@@ -255,6 +255,7 @@ static int do_ubiblock_request(struct ubiblock *dev, struct request *req)
        mutex_lock(&dev->dev_mutex);
        ret = ubiblock_read(dev, bio_data(req->bio), sec, len);
        mutex_unlock(&dev->dev_mutex);
+       rq_flush_dcache_pages(req);
 
        return ret;
 }