[Yaffs] Minor chunkID issue from UpdateObjectHeader

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Andre Renaud
Date:  
To: yaffs
Subject: [Yaffs] Minor chunkID issue from UpdateObjectHeader
I received the following error out of yaffs:

**>> yaffs: getBlockInfo block 0 is not valid
==>> yaffs bug: fs/yaffs2/yaffs_guts.h 808
Obj 0 header type is illegal value 0x0
Obj 0 header mismatch objectId 1

It appears as if it is somehow getting a chunkID of 0, which looks like
it is invalid. Having a look, this comes from yaffs_UpdateObjectHeader,
where it gets the previous chunk id. I'm not sure how this comes out as
zero, but there is a check there for >= 0, if I change it to > 0 then
this issue goes away. Since a chunkID of 0 is guaranteed to give
yaffs_ReadChunkWithTagsFromNAND grief, I can't see how this hurts
things, although it may be masking the real problem.

See patch below for details

Andre

--- yaffs_guts.c        2007-10-19 15:50:38.000000000 +1300
+++ /home/andre/snapper/linux-2.6.20/fs/yaffs2/yaffs_guts.c     2007-09-18 11:01:05.000000000 +1200
@@ -3618,7 +3618,7 @@


                prevChunkId = in->chunkId;


-               if (prevChunkId > 0) {
+               if (prevChunkId >= 0) {
                        result = yaffs_ReadChunkWithTagsFromNAND(dev, prevChunkId,
                                                        buffer, &oldTags);




--
Bluewater Systems Ltd - ARM Technology Solutions Centre

       Andre Renaud                             Bluewater Systems Ltd
Phone: +64 3 3779127 (Aus 1 800 148 751)        Level 17, 119 Armagh St
Fax:   +64 3 3779135                            PO Box 13889
Email:                  Christchurch
Web:   http://www.bluewatersys.com              New Zealand