Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3147353imm; Sun, 1 Jul 2018 13:36:38 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK7bRHEgcV0ZZL0BwQv4ZjoJKgfAlINo1WznAM1oIdW0j1YmqKcd1C2Mag0TG73haEAPgiQ X-Received: by 2002:a17:902:e281:: with SMTP id cf1-v6mr23249185plb.86.1530477398160; Sun, 01 Jul 2018 13:36:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530477398; cv=none; d=google.com; s=arc-20160816; b=jIj5+n01JxyieTB0GV9yGYohWvCdIt8n/eVYWHDDBsivXWrg+VfIVen+UtocVQDHUt juLPp4OC582OePJIsTFwTe8NMqi3KR0X3tnjBgjug6eToZKrpU+LNdFeH4c5qDISjd0l E4nVzuGFYwzACmqOYqb6YvXSAqZ8HqBJCQ/zr7b1yqTxn7vf6FuzZEj4Yzz5isUZwxPJ nGxr+ngLM1XfBG2JV6eVDQzqQDU7L3Vd7LxlSDD/YAy1Qqh2WLMt2c3uczKVAeIouFzc FPuqXV/oFu1ZEYSsFe+bEzhu7+LZuT7tay+mvexh4ypNKB9DKKelMJa9MNIbHGdEqJfu qbUw== 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=6pRHpUl674Xb0mm0+1yjvP1JXWcUP031nvh57XyRufU=; b=jLG46PhlVVCTa99eK8xXTHabuFN7+qTz2bp7DaoHiRUUIA1y3cBgJSIa1C8wVZ4SOg vNP3Lpr0MyidDIa+j255I2X3WfaJyg+XPzAiY00OBM2mOKsp6s1Lbtcob/jVXjaUbOtB OSbAzhVMhmxaP1TStkD3Lm/ro0Sq8+E57hIrMDT9gtyht62/OUUHt+6ST9A3VlKH2W76 exP8R6JE8wpxd6+LOMZDmcdd7AYM4RHsV/jABFiLVQfbxJOgnJ7/6JhQHU1kZ8+t6Cu2 d7j3dUDhyIQ78Vz+PT6RRSy7wK8IH582qHoAbMabi3ux0YR3W+nCCB9Q4p7lPhKgzCRu p9CA== 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 p18-v6si14469643pfe.150.2018.07.01.13.35.43; Sun, 01 Jul 2018 13:36:38 -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 S1752556AbeGAUdw (ORCPT + 99 others); Sun, 1 Jul 2018 16:33:52 -0400 Received: from mail.bootlin.com ([62.4.15.54]:39976 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752501AbeGAUdv (ORCPT ); Sun, 1 Jul 2018 16:33:51 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 25D7E207BE; Sun, 1 Jul 2018 22:33:49 +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 CDCD7206DE; Sun, 1 Jul 2018 22:33:48 +0200 (CEST) Date: Sun, 1 Jul 2018 22:33:47 +0200 From: Boris Brezillon To: Richard Weinberger 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 Message-ID: <20180701223347.2cef133b@bbrezillon> In-Reply-To: <382648641.QZzOm4Mo72@blindfold> References: <0ace6202bddb495ae0e632ae2fd0346f99fcdab4.1530169759.git-series.quentin.schulz@bootlin.com> <382648641.QZzOm4Mo72@blindfold> 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 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). > > + req->vol_type != UBI_STATIC_VOLUME) > > + goto bad; > > We should also reject unknown flags here. I agree. Talking about missing checks, it seems that none of the padding sections are checked (I hope all mkvol users are zero-ing the struct as requested in ubi-user.h). And we should probably also check that vtbl->flags does not contain unknown flags.