Re: [Yaffs] question about yaffs_SkipRestOfBlock function

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Charles Manning
Date:  
To: yaffs
Subject: Re: [Yaffs] question about yaffs_SkipRestOfBlock function
On Tuesday 23 July 2013 21:15:32 Linzichang wrote:
> In the latest yaffs2 source codes, there is a function:
> yaffs2_scan_backwards(), in the last of this function, it'll call
> yaffs_skip_rest_of_block(dev) function which will set FULL flag to
> allocating block, I think the reason is that the summary info of allocating
> block is missing, if we do not set FULL to it, the following block's
> summary will not be correct.


The reason for marking the block FULL is so that it is not used for any more
allocations until the block has been erased.
>
> Here list some query on this part:
>
> 1, in the old version yaffs(which did not support summary info feature or
> in the version we disable summary feature), if we can delete
> yaffs_SkipRestOfBlock() function in yaffs_ScanBackwards()?


Why do you want to do that?

>
> 2, I saw in the very old version yaffs sources codes, there is not
> yaffs_SkipRestOfBlock () function in yaffs_ScanBackwards (), in 2009, this
> commit states: /************************************/
> commit 53c45617c6cbeffcafce1e96e868fcf516e62373
> Author: charles <charles>
> Date: Mon Dec 14 22:03:05 2009 +0000
>
> New partial block handing to improve robustness
>
> diff --git a/yaffs_guts.c b/yaffs_guts.c
> index a51d82d..4af4c40 100644
> --- a/yaffs_guts.c
> +++ b/yaffs_guts.c
>
> /************************************/
>
> I failed to find the reason for the importing of this function from sources
> codes and some design doc on yaffs, would anyone please to give some
> comments why this will improve robustness.



In the old days yaffs would pick up writing a block from where it left off on
the last mount.

What we found was that on some flash arrays the last chunk might have been
partially written when power was lost. If we just resumed writing at that
point then we might be writing over partially written flash which would
likely cause problems.

This lead to calling yaffs_skipRestOfBlock() which marks a partially written
block as full so that writing always starts on a fresh block.

-- Charles