From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933238AbbI3J5c (ORCPT ); Wed, 30 Sep 2015 05:57:32 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:46824 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933139AbbI3Jye (ORCPT ); Wed, 30 Sep 2015 05:54:34 -0400 From: Luis Henriques To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Cc: Kevin Cernekee , Ezequiel Garcia , Richard Weinberger , Luis Henriques Subject: [PATCH 3.16.y-ckt 126/133] UBI: block: Add missing cache flushes Date: Wed, 30 Sep 2015 10:51:14 +0100 Message-Id: <1443606681-7124-127-git-send-email-luis.henriques@canonical.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1443606681-7124-1-git-send-email-luis.henriques@canonical.com> References: <1443606681-7124-1-git-send-email-luis.henriques@canonical.com> X-Extended-Stable: 3.16 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.7-ckt18 -stable review patch. If anyone has any objections, please let me know. ------------------ From: Kevin Cernekee 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 Signed-off-by: Ezequiel Garcia Signed-off-by: Richard Weinberger [ luis: backported to 3.16: used Kevin's backport to 3.14 ] Signed-off-by: Luis Henriques --- drivers/mtd/ubi/block.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/ubi/block.c b/drivers/mtd/ubi/block.c index 8457df7ec5af..8b4a182d7cf9 100644 --- a/drivers/mtd/ubi/block.c +++ b/drivers/mtd/ubi/block.c @@ -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; }