public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: syed khader <sk.syed@yahoo.com>
To: linux-mtd@lists.infradead.org
Subject: Re: CRC errors when continuous fseek/fputs on JFFS2
Date: Tue, 16 May 2006 05:40:46 -0700 (PDT)	[thread overview]
Message-ID: <20060516124046.35261.qmail@web37910.mail.mud.yahoo.com> (raw)
In-Reply-To: <20060516061354.GA18958@wohnheim.fh-wedel.de>


Hi 
  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??

Regards
Syed



--- J�rn Engel <joern@wohnheim.fh-wedel.de> wrote:

> On Mon, 15 May 2006 21:58:47 -0700, syed khader
> wrote:
> > 
> >   My question is not how the test case  should be
> > written, why would CRC errors appear when I never
> > powered off my system while it is writing into
> jffs2.
> >   I would like to ask what would happen if a
> integer
> > overflow occurs: does it result in crc error?
> 
> Anything resulting in a crc error is a bug.  But I
> cannot tell you
> much more with your current testcase.  fwrite() is
> implemented by the
> libc and does buffering.  Therefore it is impossible
> to tell when libc
> actually calls the kernel and which functions it
> calls with which
> parameters.  And that makes debugging fairly hard.
> 
> So a temporary question is indeed how the testcase
> should be written.
> Please replace the f* functions so we can remove
> libc from the
> picture.
> 
> J�rn
> 
> -- 
> Invincibility is in oneself, vulnerability is in the
> opponent.
> -- Sun Tzu
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

       reply	other threads:[~2006-05-16 12:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20060516061354.GA18958@wohnheim.fh-wedel.de>
2006-05-16 12:40 ` syed khader [this message]
2006-05-16 14:26   ` CRC errors when continuous fseek/fputs on JFFS2 Jörn Engel
2006-05-16 15:01     ` syed khader
2006-05-16 15:31       ` Jörn Engel
2006-05-17  5:12         ` syed khader
2006-05-17  6:25           ` zlib compression is failing syed khader
2006-05-17  9:10             ` Jörn Engel
2006-05-17 10:42               ` Josh Boyer
2006-05-17 11:22               ` syed khader
2006-05-17 13:19                 ` Jörn Engel
2006-05-17 13:48                   ` syed khader
2006-05-17 14:28                     ` David Woodhouse
2006-05-15 15:15 CRC errors when continuous fseek/fputs on JFFS2 syed khader
2006-05-15 15:46 ` Jörn Engel
2006-05-15 15:57   ` Jörn Engel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060516124046.35261.qmail@web37910.mail.mud.yahoo.com \
    --to=sk.syed@yahoo.com \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox