Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3698422ybv; Mon, 10 Feb 2020 04:56:14 -0800 (PST) X-Google-Smtp-Source: APXvYqydhy6lU2XpyhFxNiKk6ZBeU0kBBle8PWf6b8OJ+XyT1rizrYjy9AML/dv1xVkEYKhkXtPb X-Received: by 2002:a05:6830:18f5:: with SMTP id d21mr940241otf.225.1581339374701; Mon, 10 Feb 2020 04:56:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581339374; cv=none; d=google.com; s=arc-20160816; b=Bp7mScCcL7VlfQoML5FpYnG1fuRpqIbSSYC6/3IWgqey24E7+JbeBfWHhHjhXlOBpC IGkwsO4uVA/aDDxsuUU1ZndaX/jeDicz63x993KYeCZ042xJFRoHapJfZEBiIEQmrLiA uJxUKcvITiXQlMOg/BJSFiVaftYvCl4+7bliQkb7xA8He4C3mYj/QbwXnRnv/HixgVCa RvvH2Dshm6NpJjmaq4sAkgJEXaQMzbc1i7ET6m6psIhnzvbe8gLQ3z55tOQiOwRG0rEi mfL2woemrsd0gYzqwTc5q8zzmuiFRe2eq9MvZ7qTOPUDt3Irl/bz7hPawrGDJuyNs5lz XwDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Db4uxKob+Stbhct+8KRtsWtJcCFKzr+RGgnKqazIKr4=; b=crhfJ0KOj9V0qRNisbGMUQoH2KkimQPS38JwcMOc1i1t5XQZ2MuWpfvNrQQjvzkSVQ 3dRA1ZoBxXAy6/61guQAIst4u2jYUsCsjo9m0oXNpeM34CSd2y7yJUftsf4LhYEHLmsx En9YhG0TTyNiTWgU3JJX+cveu6rstQuq9Lpm7nUeG5Xn+4a3DBBNaoEkcTklRH4RvJOp AJeikJJHDYUOcFnE/DVwPwWgF99AQVdjJXQQXQTBxLQwqrklqsTX5aVMfMhnuIjqQIBy CaPY11gnsamjTuhKpZIgmv3qYIzOO9zbBZKG0cPrVTMbZv/u99pp/il4tXrZbaaaycd9 9tHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dXyW91XM; 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 l8si126282oii.249.2020.02.10.04.56.03; Mon, 10 Feb 2020 04:56:14 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=dXyW91XM; 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 S1730140AbgBJMz7 (ORCPT + 99 others); Mon, 10 Feb 2020 07:55:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:44660 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730059AbgBJMlo (ORCPT ); Mon, 10 Feb 2020 07:41:44 -0500 Received: from localhost (unknown [209.37.97.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 28AEE24688; Mon, 10 Feb 2020 12:41:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581338504; bh=8YWEqfZzJiB2wQyBg/KeYsZbbnwq/3ktB7xKinpWvGo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dXyW91XM653WiN7+7CAveiJnHHv294CDOHdwUo6o/UZnxM7CFE6iorKsB0JoWxqUl d6KeP33qCZWP6cdDoLIBLw5VjCJSfjVbfPUt7jITW3iE9cVs2213uQN/9ImzEtvfXZ quJ7pbTz9SEzl3bRyXWlka/XRCGe7UJa+tMdZpfU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sascha Hauer , Richard Weinberger Subject: [PATCH 5.5 303/367] ubi: fastmap: Fix inverted logic in seen selfcheck Date: Mon, 10 Feb 2020 04:33:36 -0800 Message-Id: <20200210122451.475025673@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200210122423.695146547@linuxfoundation.org> References: <20200210122423.695146547@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sascha Hauer commit ef5aafb6e4e9942a28cd300bdcda21ce6cbaf045 upstream. set_seen() sets the bit corresponding to the PEB number in the bitmap, so when self_check_seen() wants to find PEBs that haven't been seen we have to print the PEBs that have their bit cleared, not the ones which have it set. Fixes: 5d71afb00840 ("ubi: Use bitmaps in Fastmap self-check code") Signed-off-by: Sascha Hauer Signed-off-by: Richard Weinberger Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/ubi/fastmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/mtd/ubi/fastmap.c +++ b/drivers/mtd/ubi/fastmap.c @@ -64,7 +64,7 @@ static int self_check_seen(struct ubi_de return 0; for (pnum = 0; pnum < ubi->peb_count; pnum++) { - if (test_bit(pnum, seen) && ubi->lookuptbl[pnum]) { + if (!test_bit(pnum, seen) && ubi->lookuptbl[pnum]) { ubi_err(ubi, "self-check failed for PEB %d, fastmap didn't see it", pnum); ret = -EINVAL; }