[prev in list] [next in list] [prev in thread] [next in thread] 

List:       yaffs
Subject:    Re: [Yaffs] question about yaffs_SkipRestOfBlock function
From:       Linzichang <linzichang () huawei ! com>
Date:       2013-07-26 2:13:07
Message-ID: 997169B51BA36249AD82738E73C10F2D44938482 () szxeml557-mbx ! china ! huawei ! com
[Download RAW message or body]


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

_______________________________________________
yaffs mailing list
yaffs@lists.aleph1.co.uk
http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic