CRC errors when continuous fseek/fputs on JFFS2

Jörn Engel joern at wohnheim.fh-wedel.de
Tue May 16 10:26:18 EDT 2006


On Tue, 16 May 2006 05:40:46 -0700, syed khader wrote:
> 
>   when I removed fseek/fwrite in the test case I am
> not seeing any CRC errors. The modified code goes like
> this :
> 
> int main()
> {
>    int fd;
>    int i;
>    char buf[SIZE];
> 
>    strcpy(buf, "abcdefg\r\n");
>    printf("%s", buf);
>    fd = open("testfile",O_RDWR|O_CREAT);
>    for(i =0 ; i < 10 ; i++)
>    {
>       write(fd, buf, sizeof(buf));
>       lseek(fd, -4, SEEK_CUR);
>   }
> }
>    Why does CRC errors occur when I use fseek/fwrite
> and not when I use plain system calls write/lseek??

Because it doesn't do the same thing.  But what did the fseek/fwrite
version do?

Can you run the old testcase with strace?  Something like

$ strace -v 1>1 2>2 your_testcase

Then send us the contents of 2.

Jörn

-- 
When in doubt, punt.  When somebody actually complains, go back and fix it...
The 90% solution is a good thing.
-- Rob Landley




More information about the linux-mtd mailing list