From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751331AbdHFJna (ORCPT ); Sun, 6 Aug 2017 05:43:30 -0400 Received: from b.ns.miles-group.at ([95.130.255.144]:44723 "EHLO radon.swed.at" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751179AbdHFJn3 (ORCPT ); Sun, 6 Aug 2017 05:43:29 -0400 Subject: Re: [PATCH 5/5] ubi: Allow to use read-only UBI volume with not enough PEBs To: =?UTF-8?Q?Pali_Roh=c3=a1r?= Cc: David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Artem Bityutskiy , "linux-mtd@lists.infradead.org" , LKML References: <1496418222-23483-1-git-send-email-pali.rohar@gmail.com> <1496418222-23483-6-git-send-email-pali.rohar@gmail.com> <20170725142729.GL30901@pali> From: Richard Weinberger Message-ID: <0527d020-95aa-80e5-978c-fa9b6761a273@nod.at> Date: Sun, 6 Aug 2017 11:43:25 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170725142729.GL30901@pali> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Pali, Am 25.07.2017 um 16:27 schrieb Pali Rohár: >> I fear this is not correct, it will disable a legit self-check of UBI volumes. >> If the read-only volume is corrupted/truncated and you miss PEBs, this >> check will no longer >> trigger. >> >> Especially when dealing with nanddumps, truncation is a common problem. > > Any idea how to fix it? Or how to handle read-only images which are > marked for auto-resize? I'd vote for rejecting images that have auto-resize set when the MTD is read-only. In fact, using UBI on top of a read-only MTD is very uncommon and not recommended (for NAND). The auto-resize flag should be also only set when you just have created it using mkfs.ubifs. Why would you inspect such an image with the kernel UBIFS unless you're hunting down a bug in mkfs.ubifs? Thanks, //richard