Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3551616imm; Mon, 2 Jul 2018 00:51:51 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLoEGCg3IqX4VZRzF8nzAJzs4ZH2jIDKaKAMcuMF+m3ZJxgpsHDpikQuJ19AS6HxYnq+LSN X-Received: by 2002:a63:bd01:: with SMTP id a1-v6mr20695207pgf.319.1530517910952; Mon, 02 Jul 2018 00:51:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530517910; cv=none; d=google.com; s=arc-20160816; b=IjcxQCbNIiHSXrlP6TbmpaSSWofpE/oAqajVXWmQ5ePf3zIYluleTkz5bWN+6OVBin 73cFQ6rrntZqarADIrcmQpQrXfRdKCmG9yFVt1CsR4QiOKaY06Miw39odtHOk138BKxA zRUpul69Fy8AVcdRDk6/8Ec4obHaFUC0XfNnDJR9pddw/GIeQX9hxvbzikxv4RkfAHIn p9rHOyTl0Gs4ZzpiypkXT0Nf3D4cZGA8ZG4QgULSqt7pw0JfRp+1s/QWC3vypsT2Ezfp 7J1GMTm0baSswkHYssQ42dbM2YixxODn97bdWx980B5CQUy6k3lMZ/tzfV3ADcXds4DO 7/Qg== 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:date:cc:to:reply-to:from:subject:message-id :arc-authentication-results; bh=DcBE8Itlu4mh9AcjwG9qTvaJ4NWYaXPSYHWhX02kX3E=; b=wxdFBafq2+hXsLYnRFyyw2HJ/dJWIfeIw+3O/MBa3eyRP+kENaNzWL9MuAAexCBzvO TnLggUYekmk7AZNVdhzcthiyWt+a1HvF0Kk/LA9hA7BVEd00sjcy9zPfnqnuNdqMetht vP7VBwu1dd6PkCOxN7KEBXi4sB4TB25HbV0mmPl5HDnY6qVfoX4IJ26uFP/fN2emJOis 4AXmDsXRoeX1ffyIKTvI4n0EblzRFe2wv0Bjkh9TDLLz36178URZkWJO3gXpy5+e8nGZ dggwfTn6zacyraJOAz/ccDOhWxv6O8keuhwY+SfodOP9G2hZBYRUwxzSII5hjPUsLKN7 jSrg== 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u19-v6si347038pgk.100.2018.07.02.00.51.36; Mon, 02 Jul 2018 00:51:50 -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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753689AbeGBHuH (ORCPT + 99 others); Mon, 2 Jul 2018 03:50:07 -0400 Received: from mga14.intel.com ([192.55.52.115]:34566 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753225AbeGBHuG (ORCPT ); Mon, 2 Jul 2018 03:50:06 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jul 2018 00:50:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,298,1526367600"; d="scan'208";a="69360694" Received: from linux.intel.com ([10.54.29.200]) by orsmga001.jf.intel.com with ESMTP; 02 Jul 2018 00:49:48 -0700 Received: from abityuts-desk.fi.intel.com (abityuts-desk.fi.intel.com [10.237.68.39]) by linux.intel.com (Postfix) with ESMTP id 2BD6F5802B1; Mon, 2 Jul 2018 00:49:45 -0700 (PDT) Message-ID: <1530517784.469.94.camel@gmail.com> Subject: Re: [PATCH v3 1/2] ubi: provide a way to skip CRC checks From: Artem Bityutskiy Reply-To: dedekind1@gmail.com To: Richard Weinberger Cc: Quentin Schulz , dwmw2@infradead.org, computersforpeace@gmail.com, boris.brezillon@bootlin.com, marek.vasut@gmail.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com Date: Mon, 02 Jul 2018 10:49:44 +0300 In-Reply-To: <1814021.2UnKZ8bNR8@blindfold> References: <3f9cef553d4f5da3fe2d76113d79ada1f0fe5224.1530169759.git-series.quentin.schulz@bootlin.com> <1530516625.469.82.camel@gmail.com> <1814021.2UnKZ8bNR8@blindfold> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 (3.26.6-1.fc27) Mime-Version: 1.0 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, 2018-07-02 at 09:43 +0200, Richard Weinberger wrote: > Artem, > > Am Montag, 2. Juli 2018, 09:30:25 CEST schrieb Artem Bityutskiy: > > Hi, > > > > On Thu, 2018-06-28 at 09:40 +0200, Quentin Schulz wrote: > > > diff --git a/drivers/mtd/ubi/kapi.c b/drivers/mtd/ubi/kapi.c > > > index d4b2e87..e9e9ecb 100644 > > > --- a/drivers/mtd/ubi/kapi.c > > > +++ b/drivers/mtd/ubi/kapi.c > > > @@ -202,7 +202,7 @@ struct ubi_volume_desc *ubi_open_volume(int > > > ubi_num, int vol_id, int mode) > > > desc->mode = mode; > > > > > > mutex_lock(&ubi->ckvol_mutex); > > > - if (!vol->checked) { > > > + if (!vol->checked && !vol->skip_check) { > > > /* This is the first open - check the volume */ > > > err = ubi_check_volume(ubi, vol_id); > > > if (err < 0) { > > > > Did you deliberately did not add a similar check to > > 'vol_cdev_write()' ? > > You want to skip checking on load but do have the checking after > > volume update ? > > Looks a bit inconsistent to me. At the very least deserves a > > comment in > > 'vol_cdev_write()' about why 'skip_check' flag is ignored there. > > Well, the idea is skipping the check, not the crc32 on the medium. > That way we can later, if needed, offer a way to drop the flag but > and don't have to rewrite with crc32-enabled. I understand that. I am talking about cdev.c line 370. We will check the CRC after the update regardless of 'skip_check'. So I point out that this is not very consistent with what we do in 'ubi_open_volume()'. Is this deliberate or not? If this is deliberate, we should at least add an explanation comment in 'vol_cdev_write()'.