UBIFS Corrupt during power failure

Eric Holmberg Eric_Holmberg at Trimble.com
Tue Mar 24 14:16:43 EDT 2009


> I'll keep working on a better way to reproduce the problem.  
> Let me know if I need to add some printk statements somewhere and/or
enable UBI or MTD debugging. 

Here's an easier way to create a similar corruption of the file system
by creating the device nodes on /dev as part of the UBIFS root file
system instead of mounting tmpfs on /dev.

Note that I'm using the Busybox (1.12.4) mdev utility to create the
device nodes:

 1. Setup a system that uses UBIFS as the root file system
 2. Skip mounting tmpfs on /dev (mount -t tmpfs none /dev)
 3. Create the device nodes on /dev
	mount -t sysfs none /sys
	mdev -s

Now that the device nodes (including the /dev/ubi* and /dev/mtd* nodes)
have been created on the RFS, doing an unmount will cause corruption of
the UBI RFS:

	umount -a
	reboot -f

I know this is an odd case, but it looks like it simulates the same
failure very well on my board without having to cycle power while
writing to flash.

Basic board information:
  Linux 2.6.27
  UBIFS on 32MB NOR Flash mapped using physmap driver
  Atmel ARM9 AT91SAM9263
  
-Eric

-----Original Message-----
From: linux-mtd-bounces at lists.infradead.org
[mailto:linux-mtd-bounces at lists.infradead.org] On Behalf Of Eric
Holmberg
Sent: Tuesday, March 24, 2009 11:04 AM
To: Adrian Hunter
Cc: linux-mtd at lists.infradead.org
Subject: RE: UBIFS Corrupt during power failure

Hi Adrian,

> Please enable UBIFS debugging and set the UBIFS Default message level
to 3.

Thanks for the response.  Enabling UBIFS debugging and setting to level
3 only provides slightly more information.  

[42949375.480000] UBIFS: recovery needed [42949376.450000] UBIFS error
(pid 1): ubifs_scan: corrupt empty space at LEB 4:44512
[42949376.460000] UBIFS error (pid 1): ubifs_scanned_corruption:
corrupted data at LEB 4:44512
[42949376.470000] UBIFS error (pid 1): ubifs_scanned_corruption: first
4096 bytes from LEB 4:44512
[42949376.490000] UBIFS error (pid 1): ubifs_scan: LEB 4 scanning failed
[42949376.540000] UBIFS error (pid 1): ubifs_recover_leb: corrupt empty
space at LEB 4:480 [42949376.550000] UBIFS error (pid 1):
ubifs_scanned_corruption:
corrupted data at LEB 4:480
[42949376.560000] UBIFS error (pid 1): ubifs_scanned_corruption: first
4096 bytes from LEB 4:480
[42949376.580000] UBIFS error (pid 1): ubifs_recover_leb: LEB 4 scanning
failed [42949376.600000] VFS: Cannot open root device "ubi0:rootfs" or
unknown-block(0,0)


> Also, could you tell us what MTD drivers you are using?
I'm using the physmap CFI flash driver for a CFI-compliant S29GL256P90F
256Mbit NOR flash chip.  Is that what you're asking for?

I'll keep working on a better way to reproduce the problem.  Let me know
if I need to add some printk statements somewhere and/or enable UBI or
MTD debugging.

Thanks,

Eric

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/



More information about the linux-mtd mailing list