[Yaffs] scan problem or bug??

Abhishek Bhattacharya abhishek.b@lgsoftindia.com
Fri, 28 Jan 2005 12:08:54 +0530


This is a multi-part message in MIME format.

------_=_NextPart_001_01C50504.0A3A99AE
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable


Hi=0D
Working with yaffs2 I have faced a strange problem. Intially to
initialise the file system, i make a call to=0D
yaffs_StartUp() and then yaffs_mount("/flash"). I am only using flash
device.
=0D
Following this I create files, which are successfully created. To see
the created files I use dumpDir("/flash"),
which clearly shows the created file and the size. All is fine upto this
stage!
=0D
But  problem starts, once I restart the system and try to reinitialize.
Well once I do this , the return messages=0D
show that all blocks starting from START BLOCK to END BLOCK are empty. (
Even though previously we have created=0D
a file of 1 MB). Next after this if I call dumpDir("/flash") I get only
lost+found dir, and the previously created file is simply gone.
=0D
But the funny thing is that , when I try to create another file after
reinitalization, it actually allocates a chunk which is the next=0D
chunk from the last chunk used ( Suppose last chunk used was X, then the
next chunk allocated will be X+1), which is a correct
behaviour.
=0D
Now I have seen , that in yaffs_Scan() we
yaffs_QueryInitialBlockState(), inside which the state is always
returned as EMPTY.
Therefore every time you scan all blocks definetely turn up as EMPTY,
and though there exists data in the flash, it shows  0 files
and complete flash as empty!
=0D
Moreover this was never a problem with yaffs1, since every time i reboot
I used to reinitialize using the same sequence, and I used=0D
to get all files and directories intact!
=0D
Does yaffs2 expect only one intialisation? If so what about reboots??
=0D
Is this a bug??? Or am I missing something while reinitalizing?
=0D
Regards
Abhishek


***************************************************************************=
***************************************************************************=
****

This email message is for the sole use of the intended recipient(s)and may=
 contain CONFIDENTIAL and PRIVILEGED information.
LG Soft India will not be responsible for any viruses or defects or any=
 forwarded attachments emanating either from within=0D
LG Soft India or outside. Any unauthorized review, use, disclosure or=
 distribution is prohibited. If you are not the intended=0D
recipient, please contact the sender By reply email and destroy all copies=
 of the original message.

***************************************************************************=
***************************************************************************=
****
------_=_NextPart_001_01C50504.0A3A99AE
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.2900.2180" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D777224605-28012005>Hi=0D
</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D777224605-28012005>Working=
 with yaffs2=0D
I have faced a strange problem. Intially to initialise the file system, i=
 make a=0D
call to </SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=
=3D777224605-28012005>yaffs_StartUp() and=0D
then yaffs_mount("/flash"). I am only using flash=
 device.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=0D
class=3D777224605-28012005></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D777224605-28012005>Following=
 this I=0D
create files, which are successfully created. To see the created files I=
 use=0D
dumpDir("/flash"),</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D777224605-28012005>which=
 clearly shows=0D
the created file and the size. All is fine upto this=
 stage!</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=0D
class=3D777224605-28012005></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D777224605-28012005>But&nbsp;=
 problem=0D
starts, once I restart the system and try to reinitialize. Well once I do=
 this ,=0D
the return messages </SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D777224605-28012005>show that=
 all blocks=0D
starting from START BLOCK to END BLOCK are empty. ( Even though previously=
 we=0D
have created </SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D777224605-28012005>a file of=
 1 MB).=0D
Next after this if I call dumpDir("/flash") I get only lost+found dir, and=
 the=0D
previously created file is simply gone.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=0D
class=3D777224605-28012005></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D777224605-28012005>But the=
 funny thing=0D
is that , when I try to create another file after reinitalization, it=
 actually=0D
allocates a chunk which is the next </SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D777224605-28012005>chunk=
 from the last=0D
chunk used ( Suppose last chunk used&nbsp;was X, then the next chunk=
 allocated=0D
will be X+1), which is a correct</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=0D
class=3D777224605-28012005>behaviour.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=0D
class=3D777224605-28012005></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D777224605-28012005>Now I=
 have seen ,=0D
that in yaffs_Scan() we yaffs_QueryInitialBlockState(), inside which the=
 state=0D
is always returned as EMPTY.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D777224605-28012005>Therefore=
 every time=0D
you scan all blocks definetely turn up as EMPTY, and though there exists=
 data in=0D
the flash, it shows&nbsp; 0 files</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D777224605-28012005>and=
 complete flash=0D
as empty!</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=0D
class=3D777224605-28012005></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D777224605-28012005>Moreover=
 this was=0D
never a problem with yaffs1, since every time i reboot I used to=
 reinitialize=0D
using the same sequence, and I used </SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D777224605-28012005>to get=
 all files and=0D
directories intact!</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=0D
class=3D777224605-28012005></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D777224605-28012005>Does=
 yaffs2 expect=0D
only one intialisation? If so what about reboots??</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=0D
class=3D777224605-28012005>&nbsp;</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D777224605-28012005>Is this a=
 bug??? Or=0D
am I missing something while reinitalizing?</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=0D
class=3D777224605-28012005></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=0D
class=3D777224605-28012005>Regards</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=0D
class=3D777224605-28012005>Abhishek</SPAN></FONT></DIV></BODY></HTML>

<table><tr><td bgcolor=3D#ffffff><font color=
=3D#000000>****************************************************************=
***************************************************************************=
***************<br><br>This email message is for the sole use of the=
 intended recipient(s)and may contain CONFIDENTIAL and PRIVILEGED=
 information.<br>LG Soft India will not be responsible for any viruses or=
 defects or any forwarded attachments emanating either from within <br>LG=
 Soft India or outside. Any unauthorized review, use, disclosure or=
 distribution is prohibited. If you are not the intended <br>recipient,=
 please contact the sender By reply email and destroy all copies of the=
 original=
 message.<br><br>**********************************************************=
***************************************************************************=
*********************<br></font></td></tr></table>
------_=_NextPart_001_01C50504.0A3A99AE--