Re: [Yaffs] minimun partition size require to mount the YAFF…

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Charles Manning
Date:  
To: yaffs
Subject: Re: [Yaffs] minimun partition size require to mount the YAFFS!!!
On Monday 31 January 2011 20:20:51 Murali N wrote:
> On Mon, Jan 31, 2011 at 8:29 AM, Charles Manning
>
> <> wrote:
> > On Saturday 29 January 2011 18:06:20 Murali N wrote:
> >> Hi,
> >> Can anybody tell me what is the minimum partition size that would
> >> require YAFFS2 to be mounted?
> >> On my system i am seeing YAFFS2 mount is failing for a given partition
> >> of size 1MB ( 8 blocks ie 8 * 128K ).
> >>
> >> 7328              dev->internalEndBlock <= (dev->internalStartBlock +
> >> dev->nReservedBlocks + 2)) {   /* otherwise it is too        small */
> >> 7329                 T(YAFFS_TRACE_ALWAYS,
> >> 7330                   (TSTR
> >> 7331                    ("yaffs: NAND geometry problems: chunk size
> >> %d, type is yaffs%s, inbandTags %d "
> >> 7332                     TENDSTR), dev->totalBytesPerChunk,
> >> dev->isYaffs2 ? "2" : "", dev->inbandTags));
> >> 7333                 return YAFFS_FAIL;
> >> 7334         }
> >
> > yaffs reserves some blocks for two purposes:
> > 1) If blocks go bad then we need to have some spare to handle a problem.
> > 2) garbage collection etc needs at least one spare block to work with.
> >
> > You can change the reserved blocks to, say, 2 and yaffs should then work
> > on 8 blocks. You should be aware though that yaffs will not allow you to
> > store files in all of that space.
> >
> > -- Charles
>
> Is reserved blocks are useful to store per partition useful
> information or per file information?


That is a per-partition variable.

> Now in my case it is set to (nReservedBlocks) 5. As you mentioned if i
> change this value to
> per say '2' can't use this partition to store the regular files?


Yes that should work.


> If it is 'NO' then how do i set the nReservedBlocks to '2' only to
> applicable to a given partition and reset all will be with a default
> setting(5)?


One way to do this would be to do this:
--- a/yaffs_vfs_multi.c
+++ b/yaffs_vfs_multi.c
@@ -2835,7 +2835,7 @@ static struct super_block *yaffs_internal_read_super(int 
yaffs_version,
        param->end_block = n_blocks - 1;
        param->chunks_per_block = YAFFS_CHUNKS_PER_BLOCK;
        param->total_bytes_per_chunk = YAFFS_BYTES_PER_CHUNK;
-       param->n_reserved_blocks = 5;
+       param->n_reserved_blocks = (nblocks > 50) ? 5 : 2;
        param->n_caches = (options.no_cache) ? 0 : 10;
        param->inband_tags = options.inband_tags;



Let us know if that works for you.

Regards

Charles