Re: [Yaffs] Concerned about partially written block detected

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Charles Manning
Date:  
To: yaffs
Subject: Re: [Yaffs] Concerned about partially written block detected
On Sunday 25 April 2010 13:29:52 JoSH Lehan wrote:
> On an ARM board, running yaffs2 from NAND, it boots up OK, but every
> time, I keep seeing more and more of these messages in the kernel
> dmesg output:
>
> Partially written block NNN detected
>
> NNN is the same number, for about 10 lines in a row.
>
> Then, it becomes another number, and prints another 10-or-so lines in a
> row.
>
> I'm concerned about this, because as I keep rebooting the system, more
> and more lines like this appear. I check "dmesg" after each boot.
> Since this is an embedded system, it can never be cleanly shut down.
> I hope that yaffs2 doesn't have a problem dealing with dirty
> shutdowns.


No problem. YAFFS is designed for that purpose.
>
> Is this normal?

Yes that is normal.

I have modified the tracing so that these messages are only spat out for
YAFFS_TRACE_SCAN.

http://yaffs.net/gitweb?p=yaffs2/.git;a=commitdiff;h=b3c7045d1ba097d7669f9b5cf4d2a6800e7ac30d

> I thought that yaffs2 was supposed to recover from
> partially written blocks, and reuse those blocks eventually once
> garbage collection takes place. I'm concerned about losing NAND
> capacity over time, as eventually, every block will be partially
> written, as this ARM board will always be rudely powered off (never
> cleanly shut down).


The partially written blocks, like all unused space, will get sorted out by
the garbage collector during normal usage.That's its job :-).

This gets really heavy testing in one of my test harnesses which fakes power
failures. It tests millions of power failures and runs for the whole week
end.

> Is there anything that I should do, to solve the problem of more and
> more of these lines appearing in dmesg over time? Is there some kind
> of "yaffs2 fsck" program that needs to be ran periodically, to clean
> up the filesystem, and reclaim these partially written blocks?


There is no fsck. That's the job of the yaffs scanner and will run every time
yaffs mounts a partition without a valid checkpoint.

You can force yaffs to ignore the checkpoint (and thus force a scan) by using
the appropriate mount option:

#mount -t -o"no-checkpoint-read" yaffs2 /dev/mtdblock0 /ymnt

However I would only suggest doing this if you think there are problems.

-- Charles