From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.nokia.com ([192.100.122.233] helo=mgw-mx06.nokia.com) by bombadil.infradead.org with esmtps (Exim 4.69 #1 (Red Hat Linux)) id 1M8Zhc-00059E-A7 for linux-mtd@lists.infradead.org; Mon, 25 May 2009 12:54:59 +0000 Subject: RE: UBIFS Corrupt during power failure From: Artem Bityutskiy To: Eric Holmberg In-Reply-To: <1243240685.21646.100.camel@localhost.localdomain> References: <1239979018.3390.298.camel@localhost.localdomain> <200905150916.54091.sr@denx.de> <1242721105.3623.0.camel@localhost.localdomain> <1243240685.21646.100.camel@localhost.localdomain> Content-Type: text/plain; charset="UTF-8" Date: Mon, 25 May 2009 15:54:42 +0300 Message-Id: <1243256082.21646.114.camel@localhost.localdomain> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: Jamie Lokier , Stefan Roese , linux-mtd@lists.infradead.org, Adrian Hunter , Urs Muff Reply-To: dedekind@infradead.org List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Mon, 2009-05-25 at 11:38 +0300, Artem Bityutskiy wrote: > Presumably what happens it: UBIFS scans LEB 120. It checks the first > node, and finds CRC mismatch. Then UBIFS logic is as follows. If this > corrupted node is the last one, then there was a write interrupt, > which is harmless. But if after this node some other data follows, > this is some serious corruption. So the 'is_last_write()' function > is called, it is supposed to check that. > > In 'is_last_write()' I see it has different logic depending on whether > c->min_io_size == 1 or not. The former case is NOR case, the latter > is NAND. Well, since I know we never tested UBIFS well for NOR, > I conclude the NOR case may have a bug. Oh, this 'c->min_io_size == 1' case is just dead code, we never have c->min_io_size < 8 in UBIFS. So I just remove that (patch at the end of the e-mail). Eric, please, reproduce this problem again. Then please, do not "fix" it from u-boot. But instead, please do: 1. Enable UBIFS debugging 2. Enable recovery and mount messages, by booting with "ubifs.debug_msgs=6144" kernel parameter 3. also add the "ignore_loglevel" boot parameter 4. capture _all_ messages in minicom 5. If possible, make a full dump of your flash to play with it later. Share the messages with us. I hope we can fix these problems. Just provide us the info. -- Best regards, Artem Bityutskiy (Битюцкий Артём)