Re: [Yaffs] question about yaffs_SkipRestOfBlock function

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Linzichang
Date:  
To: Charles Manning, yaffs@lists.aleph1.co.uk
Subject: Re: [Yaffs] question about yaffs_SkipRestOfBlock function

> -----Original Message-----
> From:
> [mailto:yaffs-bounces@lists.aleph1.co.uk] On Behalf Of Charles Manning
> Sent: Wednesday, July 24, 2013 8:32 AM
> To:
> 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?
>


Because in the latest yaffs2, every mounting without checkpoint(maybe due to suddenly shutdown) will generate a a partially written block without summary if I do some write after the fs mounted.
yaffs2_scan_backwards call yaffs_skip_rest_of_block to make the new writing to find a empty block, not using the YAFFS_BLOCK_STATE_ALLOCATING block which yaffs2_scan_chunk find out.
This problem is making my yaffs2's mounting time more and more longer because of the increasing of non-summary blocks.
So I want to delete the yaffs_skip_rest_of_block and save the summary info for the YAFFS_BLOCK_STATE_ALLOCATING block when yaffs2_scan_backwards.

> >
> > 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
>


Will the partially written problem still exist if the nand driver generate the hwecc with the whole chunk(include oob, the whole nand page) that we can use to check the chunk was written complete or not.

Best Regards!

Lin