UBIFS corruption after software upgrade

Artem Bityutskiy dedekind1 at gmail.com
Fri Aug 31 07:21:01 EDT 2012


> $ ./integck -p /mnt/ubifs
> 
> ..fails soon after I run the test.  There is a ton of logged data.  I've 
> attempted to snip out the first error.

How exactly?

Sure there will be a lot of nise in dmesg because we emulate power cuts
and switch to R/O mode at random moments, so a lot of UBIFS operastions
fail and print a lot of error messages and dumps. But that's fine as
long as the system works.

The idea is that UBIFS switches to R/O mode randomly and integck will
fail with EROFS at some point. Then it will unmount the FS and mount it
back, and verify some files, then remove everything and continue, and so
on forever. This way we emulate huge amount of power cuts very quickly.

If integck fails, then the last messages of dmesg are interesting.

Last time I tested UBIFS this way, the only issues which I did not
resolve were that it was unable to mount because there was no space.
That was very rare and I had to run it for the night. I just did not
have time to dig this - must be some accounting issues.

> [  376.076585] UBIFS: cannot re-mount R/W due to prior errors
> [  376.082748] UBIFS: un-mount UBI device 1, volume 0
> [  376.095799] UBIFS error (pid 2103): ubifs_scan: bad node
> [  376.105554] UBIFS: recovered master node from LEB 1
> ============= end snip ========================
> 
> Does anything in this output suggest a direction to start digging?  I 
> would really appreciate any direction you could provide.

Hmm. I've just set up ubifs-v2.6.35 on a kvm virtual machine and started
testing like this:

$ cat ~/tmp/nandsim.sh 
#!/bin/sh

umount /mnt/ubifs
rmmod ubifs ubi mtdram nandsim

dmesg -c > /dev/null
modprobe nandsim first_id_byte=0xec second_id_byte=0xd3 third_id_byte=0x51 fourth_id_byte=0x95
modprobe ubi mtd=0
modprobe mtdchar
ubimkvol /dev/ubi0 --lebs 4064 -N xyZ
mount -t ubifs /dev/ubi0_0 /mnt/ubifs
echo 1 > /sys/kernel/debug/ubifs/tst_recovery
#echo 'format "UBIFS DBG" +pf' > /sys/kernel/debug/dynamic_debug/control

$ sudo ~/tmp/nandsim.sh
# sudo ./integck /mnt/ubifs/

Let's see. I will try to look at failures, but so far it works fine. But
I do not promise anything - I have limited amount of time for this hobby
stuff.

-- 
Best Regards,
Artem Bityutskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20120831/fa1eff7a/attachment.sig>


More information about the linux-mtd mailing list