Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3591380imm; Mon, 2 Jul 2018 01:47:04 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdezESm6pAxGj3KttvYG368Hq7WzwDkjgQiEkrrBunhZooBVAopidjYQtNJ4mOdZwTbrA+o X-Received: by 2002:a63:9a52:: with SMTP id e18-v6mr4234997pgo.188.1530521224275; Mon, 02 Jul 2018 01:47:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530521224; cv=none; d=google.com; s=arc-20160816; b=fZdpLTTYdc6cMfN0CifcFj6+8UqZdB8b0rxuoZa4QA7+/nycmZWar1EaI2rwrEXlab mOXJMoawLqv9dcULmMvOnhl85x5UHiS1S5VhnlnRrbG1wQwT2rS3z959aDvo7W3+BGXb J1tmY1qTy6/ojl4RHdSLgp9olKw9VYnejAUJ8MIsplVfeUhDKrM3iFW8dmebU+J0K6as muad6a+mbo5fMriaAgna5oNwqkzqWXUNKGwtLrdSqRz+SO33SQ0mEzuw3j7vG1tpmscD UWCgkG9SxcnvaRb8ZrISvJTpQJBkOwGejuOHq1Jfoap05Gzh2GmNqo14KYNgDykb/+lx Apig== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=K01RyNWCt3qNGOXcbjme230uVgDEv97Rb+zaT9xKlzg=; b=puCZiZ2vJCDfi272LxpZbwI3hJ+6wqGfgOKd2UoLKa+Q2IAEEz+iTeodORnR2rZdMo 7pYcX7Toa1AhqfLK6MHEYnKX8tPKTNwX9IFITLShhnKQaHUA1QvrBK8C+lCc93P1Pr/n oMpCSTdm2zWesqfSgld5aR1adedKKQ5TJvmKoCJ4Ch5gMG1S9N8hh7BKD4ZICVzCAkV3 gwCE6imvQvBHpJP07G/BiGMnSvLhERJDppe6IliBTSg/UXSFdTPmejoktfqNYYSgQXmJ ZPX6Z3+KRhjCCxWaNcJQ4DEWwgNw8Xm7HubwXZ64VzVda1hnEBYAlkyirkoX21djZ9L3 l85w== 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 s184-v6si13990777pgb.161.2018.07.02.01.46.49; Mon, 02 Jul 2018 01:47:04 -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 S932604AbeGBGyU (ORCPT + 99 others); Mon, 2 Jul 2018 02:54:20 -0400 Received: from lithops.sigma-star.at ([195.201.40.130]:42214 "EHLO lithops.sigma-star.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932453AbeGBGyT (ORCPT ); Mon, 2 Jul 2018 02:54:19 -0400 Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 91E80608D739; Mon, 2 Jul 2018 08:54:17 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id jdzw5xRWxUgb; Mon, 2 Jul 2018 08:54:17 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 3C82A60A359C; Mon, 2 Jul 2018 08:54:17 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id SZV_Ke_lHsWt; Mon, 2 Jul 2018 08:54:17 +0200 (CEST) Received: from blindfold.localnet (089144195003.atnat0004.highway.a1.net [89.144.195.3]) by lithops.sigma-star.at (Postfix) with ESMTPSA id 15A0560A3593; Mon, 2 Jul 2018 08:54:17 +0200 (CEST) From: Richard Weinberger To: Boris Brezillon Cc: Quentin Schulz , dedekind1@gmail.com, dwmw2@infradead.org, computersforpeace@gmail.com, marek.vasut@gmail.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com Subject: Re: [PATCH v3 2/2] ubi: expose the volume CRC check skip flag Date: Mon, 02 Jul 2018 08:54:09 +0200 Message-ID: <2109705.Xvz1DYdJuj@blindfold> In-Reply-To: <20180702085227.2b418264@bbrezillon> References: <20180702064433.kvxcacdhuenzk5j3@qschulz> <20180702085227.2b418264@bbrezillon> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Montag, 2. Juli 2018, 08:52:27 CEST schrieb Boris Brezillon: > On Mon, 2 Jul 2018 08:44:33 +0200 > Quentin Schulz wrote: > > > Hi Richard, Boris, > > > > On Sun, Jul 01, 2018 at 10:50:41PM +0200, Richard Weinberger wrote: > > > Am Sonntag, 1. Juli 2018, 22:33:47 CEST schrieb Boris Brezillon: > > > > On Sun, 01 Jul 2018 21:35:57 +0200 > > > > Richard Weinberger wrote: > > > > > > > > > Quentin, > > > > > > > > > > Am Donnerstag, 28. Juni 2018, 09:40:53 CEST schrieb Quentin Schulz: > > > > > > Now that we have the logic for skipping CRC check for static UBI volumes > > > > > > in the core, let's expose it to users. > > > > > > > > > > > > This makes use of a padding byte in the volume description data > > > > > > structure as a flag. This flag only tell for now whether we should skip > > > > > > the CRC check of a volume. > > > > > > > > > > > > This checks the UBI volume for which we are trying to skip the CRC check > > > > > > is static. > > > > > > > > > > > > Suggested-by: Boris Brezillon > > > > > > Signed-off-by: Quentin Schulz > > > > > > Reviewed-by: Boris Brezillon > > > > > > --- > > > > > > drivers/mtd/ubi/cdev.c | 4 ++++ > > > > > > drivers/mtd/ubi/vmt.c | 3 +++ > > > > > > include/uapi/mtd/ubi-user.h | 16 ++++++++++++++-- > > > > > > 3 files changed, 21 insertions(+), 2 deletions(-) > > > > > > > > > > > > diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c > > > > > > index 45c3296..3eea1df 100644 > > > > > > --- a/drivers/mtd/ubi/cdev.c > > > > > > +++ b/drivers/mtd/ubi/cdev.c > > > > > > @@ -622,6 +622,10 @@ static int verify_mkvol_req(const struct ubi_device *ubi, > > > > > > req->vol_type != UBI_STATIC_VOLUME) > > > > > > goto bad; > > > > > > > > > > > > + if (req->flags & UBI_VOL_SKIP_CRC_CHECK_FLG && > > > > > > > > Oops, missed that req->flags & UBI_VOL_SKIP_CRC_CHECK_FLG check was > > > > missing parens (checkpatch --strict should complain about that). > > > > > > Latest when building my local branch or in linux-next we had noticed. > > > No need to worry. > > > > > > > > > + req->vol_type != UBI_STATIC_VOLUME) > > > > > > + goto bad; > > > > > > > > > > We should also reject unknown flags here. > > > > > > > > I agree. > > > > Should I send another version of my patches for it? Yes. Please. > Yes please, respin your series with this additional check. Just define > > #define UBI_VOL_VALID_FLGS (UBI_VOL_SKIP_CRC_CHECK_FLG) > > and then, in verify_mkvol_req() add > > if (req->flags & ~UBI_VOL_VALID_FLGS) > goto bad; Yep. > > Same for > > parenthesis around the flags masking above? > > No need to fix that one (unless Richard cares), as it seems I had it > wrong. Nah. If both gcc and checkpatch don't complain, let's keep it as-is. Thanks, //richard