Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3522372imm; Mon, 2 Jul 2018 00:07:42 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJgAUlJESivvats/Db7gYqFkN5M0D1nen2YvJbC4T8to0BcD9YVjJv8+AEWpAcBgYHYWTC3 X-Received: by 2002:a17:902:a581:: with SMTP id az1-v6mr24918390plb.61.1530515262721; Mon, 02 Jul 2018 00:07:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530515262; cv=none; d=google.com; s=arc-20160816; b=SdHmEcclJWaHjZYkYtwDTy/xaE0iBYRR80XWtFGVTUp/eL/fphGPnJuX3UlN1m8YeE ause53PtGQXUAYSgxmPjFfCJ112NocsGIAuENVVG10/IycOwc2ZEWUrVSdf9hsfCj+Vq cQNpmA4pluY6FDN3aWcp78Hqybt5rWHaMMXEw39UawsW3lIeHs/yGJBG0NRlTSex09cM gTyRvNy+szjaBC4cUeyrBtRmu0N/FEfFqtQQIRZ08klTA7cVx4S23qcd6yCpWPX7fIaX 8f7249umc9wIbNhAN8HtJ9UzEjgUvpQPQWOQhHCskz5vQxKk0iXGI7BY5kYkARrWGvxK SNEw== 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:subject:cc:to:from:date :arc-authentication-results; bh=GR++yr6g6FWcSwA2T3ItFnzgUWNlG4krAU+TjOJLhck=; b=bewPmeOvjpS+sGCztCdpk2G3fNaVuAWW5aAgcb4vsmlbb42pn8Lsv0ykItFkdzUV4s V7mI+AMkeARk9NnzM906L7CW3MpzDOxA2Yw+oiwVXn0S7E9cpXPNeLuX8t81WpnupaxM 6O6VVuzyTWvLb8WWNIFrxxMKiRvXcJ5zY4ej2NEvGxolFqw8ub+L2c7gdPKVrh5R0kOa cYjNX2Z8Sf0I8od4SQxvR5+D3XRRSLSwF9H7xmDTFBLCNWG3m1JhaMQiqzaG0QW+NdZB rfksE2mDiNQ6i1uyO2m2/WA2vhNFkER6VHvnvKqrhWnlAKdVld0JcmTUMjj3yaHvnVJM WJ9w== 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 h6-v6si5838331pgf.218.2018.07.02.00.07.28; Mon, 02 Jul 2018 00:07:42 -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 S932323AbeGBGwa (ORCPT + 99 others); Mon, 2 Jul 2018 02:52:30 -0400 Received: from mail.bootlin.com ([62.4.15.54]:46291 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753216AbeGBGw3 (ORCPT ); Mon, 2 Jul 2018 02:52:29 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 269872082B; Mon, 2 Jul 2018 08:52:27 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (91-160-177-164.subs.proxad.net [91.160.177.164]) by mail.bootlin.com (Postfix) with ESMTPSA id CD1DD2079C; Mon, 2 Jul 2018 08:52:26 +0200 (CEST) Date: Mon, 2 Jul 2018 08:52:27 +0200 From: Boris Brezillon To: Quentin Schulz Cc: Richard Weinberger , 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 Message-ID: <20180702085227.2b418264@bbrezillon> In-Reply-To: <20180702064433.kvxcacdhuenzk5j3@qschulz> References: <382648641.QZzOm4Mo72@blindfold> <20180701223347.2cef133b@bbrezillon> <3709236.JAAyN4mQyL@blindfold> <20180702064433.kvxcacdhuenzk5j3@qschulz> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, 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; > Same for > parenthesis around the flags masking above? No need to fix that one (unless Richard cares), as it seems I had it wrong.