Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5764918imm; Mon, 23 Jul 2018 05:48:49 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcxyWHPDQSnd21TXrxeten5A9BKrUg/UlkdNN4wUkvlrsXIW6JwSSx42jokLLIgT/hwj8fG X-Received: by 2002:a62:d10b:: with SMTP id z11-v6mr13121369pfg.255.1532350129030; Mon, 23 Jul 2018 05:48:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532350129; cv=none; d=google.com; s=arc-20160816; b=phYEgmowTcwn19oXzxKhmlKyBJI0o+xCgeaI1mcKMVQ14bS29Qyi1uyKYeqqpcjkZ/ 0X+Q1BV6tgH8bLatCo+IqFOoM9/ZoOdE2mQhY+1A+QhTZpmoXrUDzamq0zgBxebcPyMS gOT50qZXuF1nOMba5Z5JY8IwCDkwBV7qMSje1jPxapzU+SsgUccFGPAb74QJgCzdi6jD bjXUzWZvAZtDj1shmc57s6q/bB8OOILgdhdoiZND6voevXrpPAKErw6m0T2tWOyyMTRV /l8u+xwhrWNuoxlzhvDJLQUq/HapenS6TWVYe36wrgDEdtSmLU1x03YRuNJ8LF4rapPT fwLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=tluBS3BpluWyY5cOnZu1kTzqe4B6Kfot9X3Pj0TYGjs=; b=VEESrdPH/REB56MXwqEzypYH6hhuwIn2hHegIvBdAVGytgqsUMjE/vqOsgfgIjrqLh pQ8rylnfeIjxwVXmuBBgtg2rya4otVs6/kl4xga79PmOhFk0/NnazWy8GjoO+z18yu9u Nkh9MjJFx0d6UE5p5rzs0qAQRaRPAU3n4BOMOVbPepu4aYoASk9DyckVdLIOB/IlXi7i odSOfm12JJbNJb5t/ht2SW7TH1DCA1f/r3e9imGlcL43iC3b0TGrqK1Qg7VopqXWnkVj BubqLGSY2bYOgBIdN2FhiKd6wmDf50VLybiXPMjv4iH23CZTJoFPJmsbj3lBm0wOdPBe I82w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q23-v6si8797888pgl.275.2018.07.23.05.48.34; Mon, 23 Jul 2018 05:48:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389877AbeGWNst (ORCPT + 99 others); Mon, 23 Jul 2018 09:48:49 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:52046 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389861AbeGWNss (ORCPT ); Mon, 23 Jul 2018 09:48:48 -0400 Received: from localhost (LFbn-1-12238-233.w90-92.abo.wanadoo.fr [90.92.53.233]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 7DE5DBB3; Mon, 23 Jul 2018 12:47:44 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Richard Weinberger , Boris Brezillon Subject: [PATCH 4.4 106/107] ubi: Fix Fastmaps update_vol() Date: Mon, 23 Jul 2018 14:42:40 +0200 Message-Id: <20180723122418.822484638@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180723122413.003644357@linuxfoundation.org> References: <20180723122413.003644357@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Richard Weinberger commit f7d11b33d4e8cedf19367c09b891bbc705163976 upstream. Usually Fastmap is free to consider every PEB in one of the pools as newer than the existing PEB. Since PEBs in a pool are by definition newer than everything else. But update_vol() missed the case that a pool can contain more than one candidate. Cc: Fixes: dbb7d2a88d ("UBI: Add fastmap core") Signed-off-by: Richard Weinberger Reviewed-by: Boris Brezillon Signed-off-by: Richard Weinberger Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/ubi/fastmap.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/mtd/ubi/fastmap.c +++ b/drivers/mtd/ubi/fastmap.c @@ -326,6 +326,7 @@ static int update_vol(struct ubi_device aeb->pnum = new_aeb->pnum; aeb->copy_flag = new_vh->copy_flag; aeb->scrub = new_aeb->scrub; + aeb->sqnum = new_aeb->sqnum; kmem_cache_free(ai->aeb_slab_cache, new_aeb); /* new_aeb is older */