From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com ([134.134.136.65]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZG3yF-0001jt-VT for linux-mtd@lists.infradead.org; Fri, 17 Jul 2015 11:38:28 +0000 Message-ID: <1437133082.2507.114.camel@gmail.com> Subject: Re: UBIFS: recovery of master node From: Artem Bityutskiy Reply-To: dedekind1@gmail.com To: Richard Weinberger , Andrea Scian Cc: mtd_mailinglist Date: Fri, 17 Jul 2015 14:38:02 +0300 In-Reply-To: <55A8ADA9.70402@nod.at> References: <55A7B004.2090705@dave-tech.it> <55A8A7A4.906@dave-tech.it> <55A8ADA9.70402@nod.at> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Fri, 2015-07-17 at 09:24 +0200, Richard Weinberger wrote: > Am 17.07.2015 um 08:58 schrieb Andrea Scian: > > Il 16/07/2015 17:29, Richard Weinberger ha scritto: > > > Andrea, > > > > > > On Thu, Jul 16, 2015 at 3:22 PM, Andrea Scian > > > wrote: > > > > > > > > If I bypass that check too, I can mount UBIFS and everything > > > > inside the FS > > > > is there but, of course, I'm sure I'm doing something that may > > > > be wrong.. > > > > > > > > WDYT? > > > > > > So, you're facing bitflips on empty space? > > > > Another UBI/UBIFS "implementation" question: are there some other > > places, apart from get_master_node(), where UBIFS check empty space > > corruption and fails badly if something wrong? > > Having non-corrupted empty space is a fundamental requirement of > UBIFS. I am not sure it is that fundamental. What UBIFS needs is to distinguish between used and usused flash areas. It does this by comparing agains 0xFFs. Simple, worked fine in the past. If the space is empty, UBIFS assumes it can write to it. UBIFS is being paranoid and also verifies that entire empty space contains all 0xFFs. Also very simple, worked fine in the past. Now if you have "corrupted empty space" (i.e., you cannot write to it), this does not have to be the end of the world, you can clean it up by doing the "atomic LEB change" operation. It is just not implemented, but it could be done - matter of engineer-hours spent. Artem.