Author: Charles Manning Date: To: yaffs Subject: Re: [Yaffs] yaffs erases all files on mount
On Wednesday 13 April 2011 22:48:18 Nick Thompson wrote: > yaffs [master] snapshot from today, linux 2.6.33-rc4
>
> I have patched my kernel with yaffs for testing.
>
> I did:
>
> flash_eraseall /dev/mtd3
> mount -t yaffs /dev/mtdblock3 /mnt/nand
> cd /mnt/nand
> touch test
> cd ..
> umount nand
> mount -t yaffs /dev/mtdblock3 /mnt/nand
> cd nand
>
> ls showed no files (except for lost+found). I turned on logging of erase
> blocks (YAFFS_TRACE_ERASE) and dmesg showed the following:
>
> yaffs: dev is 32505859 name is "mtdblock3" rw
> yaffs: passed flags ""
> yaffs: yaffs: Attempting MTD mount of 31.3,"mtdblock3"
> yaffs: auto selecting yaffs2
> yaffs: block 2255 is bad
> yaffs: block 2572 is bad
> yaffs: block 2574 is bad
> yaffs: block 3387 is bad
> yaffs: block 3843 is bad
> yaffs: block 3845 is bad
> yaffs: block 4033 is bad
> yaffs: yaffs_read_super: is_checkpointed 0
> yaffs: dev is 32505859 name is "mtdblock3" rw
> yaffs: passed flags ""
> yaffs: yaffs: Attempting MTD mount of 31.3,"mtdblock3"
> yaffs: auto selecting yaffs2
> yaffs: block 2255 is bad
> yaffs: block 2572 is bad
> yaffs: block 2574 is bad
> yaffs: block 3387 is bad
> yaffs: block 3843 is bad
> yaffs: block 3845 is bad
> yaffs: block 4033 is bad
> yaffs: yaffs_read_super: is_checkpointed 0
> yaffs: yaffs_block_became_dirty block 1 state 8
> yaffs: Erased block 1
>
> Obviously it didn't like the fist block, which I assumed had my file in
> it, and decided to erase it.
This is almost certainly due to your flash driver mangling the tags stored in
oob.
>
> What else should I log to try and figure out what is going on?
Turn on some of the MTD level and verification tracing in yaffs.
You might also want to add some printks to the flash driver. > jffs2 on
> the same partition passes this same test, so I believe the NAND is work
> okay.
JFFS2 does not use oob so makes different use of the flash driver. It is
possible for one fs to work and another not if a driver is broken.