Re: [Yaffs] What a chunk ID of -1 means ?

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
Delete this message
Reply to this message
Author: Charles Manning
Date:  
To: Patrice LAPORTE
CC: yaffs@stoneboat.aleph1.co.uk
Subject: Re: [Yaffs] What a chunk ID of -1 means ?
Hello Patrice

On Fri, Mar 17, 2017 at 3:22 AM, Patrice LAPORTE <
> wrote:

> Hi all,
>
>
>
> Among other things I’m going back to some kind of “file system”
> investigation on our product, and I’m adding some trace.
>
>
>
> One trace I have questions about is this one, from function
> “yaffs_rd_data_obj” : “chunk -1 not found, zero instead”. The comment in
> the function tells that maybe we are reading a hole, so the buffer is
> memset to 0.
>


Chunk Id of -1 or 0 really mean the same thing: as far as Yaffs can tell,
the chunk does not exist. The only reason for 0 or -1 is to make a
distinction during development/debugging.

If that missing chunk is in the middle of a file then it is treated as a
"hole".

For example consider the sequence

h = open(filename,... opening for write);
write(h, buffer, 200000);
lseek(h, 300000, SEEK_SET);
write(h, buffer, 200000);

We now have a file that is 500000 bytes long, but the middle 100000 bytes
is a hole.


>
>
> But in my case I’m 99% sure there is no way our app is creating files with
> holes.
>


If you are getting holes where they should not be, then that is surely a
problem. It is highly likely this is some driver level issue (eg. ECC
handling) that is causing the data to go missing.


>
>
> Based on yaffs onli documentation (http://www.yaffs.net/
> documents/how-yaffs-works#How_various_mechanisms_work) : “ChunkId:
> Identifies where in the file this chunk belongs. A chunkId of zero
> signifies that this chunk contains an objectHeader. ChunkId==1 signifies
> the first chunk in the file (ie. At file offset 0), chunkId==2 is the next
> chunk and so on.”
>




>
>
> I can understand chunk 0 or more, but I can’t find information about a
> chunk ID of -1. The messages look to be present at startup, maybe during
> mount/scanning, but I don’t see them during normal life of the product.
>
>
>
> Since I added this log, people are seeing them and some of them start to
> panic, and I have to understand J But since the product is working very
> fine, I thing this -1 is normal, but I’d like to know what it means.
>
>
>
> Is any one of you can make this chunk -1 more clear ?
>


Regards

Charles


>
>
> Best regards
>
> Patrice
>
> _______________________________________________
> yaffs mailing list
>
> http://stoneboat.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs
>
>