From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f51.google.com ([209.85.221.51]:45496 "EHLO mail-wr1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725732AbeLBHBK (ORCPT ); Sun, 2 Dec 2018 02:01:10 -0500 Received: by mail-wr1-f51.google.com with SMTP id v6so8337034wrr.12 for ; Sat, 01 Dec 2018 11:47:53 -0800 (PST) Date: Sat, 1 Dec 2018 19:47:49 +0000 From: Sudip Mukherjee To: Greg Kroah-Hartman Cc: stable@vger.kernel.org, Lachmann@debian, Juergen , Richard Weinberger Subject: request for 4.14-stable: 25677478474a ("ubi: Initialize Fastmap checkmapping correctly") Message-ID: <20181201194749.apk2xronnemz5cwa@debian> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="fi7jod55ac3ewpy6" Content-Disposition: inline Sender: stable-owner@vger.kernel.org List-ID: --fi7jod55ac3ewpy6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Greg, This was not marked for stable but the commit which it fixes has been added to v4.14.85. -- Regards Sudip --fi7jod55ac3ewpy6 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-ubi-Initialize-Fastmap-checkmapping-correctly.patch" >>From a72f2dedb99e9839029091930865dadfd52372b7 Mon Sep 17 00:00:00 2001 From: Richard Weinberger Date: Tue, 12 Jun 2018 09:33:16 +0200 Subject: [PATCH] ubi: Initialize Fastmap checkmapping correctly commit 25677478474a91fa1b46f19a4a591a9848bca6fb upstream We cannot do it last, otherwithse it will be skipped for dynamic volumes. Reported-by: Lachmann, Juergen Fixes: 34653fd8c46e ("ubi: fastmap: Check each mapping only once") Signed-off-by: Richard Weinberger Signed-off-by: Sudip Mukherjee --- drivers/mtd/ubi/vtbl.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c index 94d7a865b135..7504f430c011 100644 --- a/drivers/mtd/ubi/vtbl.c +++ b/drivers/mtd/ubi/vtbl.c @@ -579,6 +579,16 @@ static int init_volumes(struct ubi_device *ubi, reserved_pebs += vol->reserved_pebs; /* + * We use ubi->peb_count and not vol->reserved_pebs because + * we want to keep the code simple. Otherwise we'd have to + * resize/check the bitmap upon volume resize too. + * Allocating a few bytes more does not hurt. + */ + err = ubi_fastmap_init_checkmap(vol, ubi->peb_count); + if (err) + return err; + + /* * In case of dynamic volume UBI knows nothing about how many * data is stored there. So assume the whole volume is used. */ @@ -620,16 +630,6 @@ static int init_volumes(struct ubi_device *ubi, (long long)(vol->used_ebs - 1) * vol->usable_leb_size; vol->used_bytes += av->last_data_size; vol->last_eb_bytes = av->last_data_size; - - /* - * We use ubi->peb_count and not vol->reserved_pebs because - * we want to keep the code simple. Otherwise we'd have to - * resize/check the bitmap upon volume resize too. - * Allocating a few bytes more does not hurt. - */ - err = ubi_fastmap_init_checkmap(vol, ubi->peb_count); - if (err) - return err; } /* And add the layout volume */ -- 2.11.0 --fi7jod55ac3ewpy6--