public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* JFFS 2 Question
@ 2004-07-09 23:08 Patrick Hilt
  2004-07-10  9:31 ` Mike Wellington
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Patrick Hilt @ 2004-07-09 23:08 UTC (permalink / raw)
  To: linux-mtd

Hi list!
Is there a way to make sure data is being written to physical flash when using 
JFFS2? In other words, After writing a file on a JFFS2 partition, is there 
anything that can be done to make sure that the data is getting written to 
the flash right away? Would "sync" or "fsync" have that effect?

Thanks a lot in advance for any input!!!

Happy weekend,

Patrick

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: JFFS 2 Question
  2004-07-09 23:08 JFFS 2 Question Patrick Hilt
@ 2004-07-10  9:31 ` Mike Wellington
  2004-07-10  9:38 ` Brad Campbell
  2004-07-15 16:47 ` Patrick Hilt
  2 siblings, 0 replies; 6+ messages in thread
From: Mike Wellington @ 2004-07-10  9:31 UTC (permalink / raw)
  To: linux-mtd


Guess I'm the first one to wake up and see this.

Sync "should" work.  Try it and check by doing
 
>  od -x /jffs2 

and then see if your new data is in the dump.

A foolproof way that is overkill - unmout the 
/jffs2 file system and then remount it.  Put 
that pair of commands in a script so you don't 
get tired of typing it.

-mike@bithead.com




-- Patrick Hilt <philt@pioneer-pdt.com> wrote:
> Hi list!
> Is there a way to make sure data is being written to physical flash
> when using 
> JFFS2? In other words, After writing a file on a JFFS2 partition, is
> there 
> anything that can be done to make sure that the data is getting
> written to 
> the flash right away? Would "sync" or "fsync" have that effect?
> 
> Thanks a lot in advance for any input!!!
> 
> Happy weekend,
> 
> Patrick
> 
> 
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: JFFS 2 Question
  2004-07-09 23:08 JFFS 2 Question Patrick Hilt
  2004-07-10  9:31 ` Mike Wellington
@ 2004-07-10  9:38 ` Brad Campbell
  2004-07-10 10:18   ` Thomas Gleixner
  2004-07-10 11:50   ` Wolfgang Denk
  2004-07-15 16:47 ` Patrick Hilt
  2 siblings, 2 replies; 6+ messages in thread
From: Brad Campbell @ 2004-07-10  9:38 UTC (permalink / raw)
  To: Patrick Hilt; +Cc: linux-mtd

Patrick Hilt wrote:
> Hi list!
> Is there a way to make sure data is being written to physical flash when using 
> JFFS2? In other words, After writing a file on a JFFS2 partition, is there 
> anything that can be done to make sure that the data is getting written to 
> the flash right away? Would "sync" or "fsync" have that effect?

I believe that jffs2 is a synchronous filesystem in any case. By the time your application has 
returned from the write() call, the data is on flash.

It certainly worked that way while I was debugging some software that did stupid things like write 
800kb files 1 byte at a time.

Regards,
Brad

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: JFFS 2 Question
  2004-07-10  9:38 ` Brad Campbell
@ 2004-07-10 10:18   ` Thomas Gleixner
  2004-07-10 11:50   ` Wolfgang Denk
  1 sibling, 0 replies; 6+ messages in thread
From: Thomas Gleixner @ 2004-07-10 10:18 UTC (permalink / raw)
  To: Brad Campbell; +Cc: Patrick Hilt, linux-mtd

On Sat, 2004-07-10 at 11:38, Brad Campbell wrote:
> Patrick Hilt wrote:
> > Hi list!
> > Is there a way to make sure data is being written to physical flash when using 
> > JFFS2? In other words, After writing a file on a JFFS2 partition, is there 
> > anything that can be done to make sure that the data is getting written to 
> > the flash right away? Would "sync" or "fsync" have that effect?
> 
> I believe that jffs2 is a synchronous filesystem in any case. By the time your application has 
> returned from the write() call, the data is on flash.

You're right and wrong. :)

On standard NOR FLASH it is synchronous. On NAND/AND FLASH and some
strange NOR FLASH types we must write page aligned and therefor were use
a write buffer of page size, which is either flushed timed by kupdated
or by sync/fsync/ummount.

tglx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: JFFS 2 Question
  2004-07-10  9:38 ` Brad Campbell
  2004-07-10 10:18   ` Thomas Gleixner
@ 2004-07-10 11:50   ` Wolfgang Denk
  1 sibling, 0 replies; 6+ messages in thread
From: Wolfgang Denk @ 2004-07-10 11:50 UTC (permalink / raw)
  To: Brad Campbell; +Cc: Patrick Hilt, linux-mtd

In message <40EFB906.7060701@wasp.net.au> you wrote:
> 
> I believe that jffs2 is a synchronous filesystem in any case. By the time your application has 
> returned from the write() call, the data is on flash.

At least on NAND flash it might just be in the write buffer, though.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
COBOL is for morons.                                 -- E.W. Dijkstra

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: JFFS 2 Question
  2004-07-09 23:08 JFFS 2 Question Patrick Hilt
  2004-07-10  9:31 ` Mike Wellington
  2004-07-10  9:38 ` Brad Campbell
@ 2004-07-15 16:47 ` Patrick Hilt
  2 siblings, 0 replies; 6+ messages in thread
From: Patrick Hilt @ 2004-07-15 16:47 UTC (permalink / raw)
  To: linux-mtd

Hi guys!
Thanks a lot or your input. Definitely appreciate it!!
In the project I am working on, we have been seeing an occasional corruption 
of our JFFS2 partition upon sudden loss of power and we get that even after 
writing to the parition and sync'ing. Could that be caused by the power loss 
happening during a block rotation / garbage collection?

Thanks again,

Patrick


On Friday 09 July 2004 04:08 pm, Patrick Hilt wrote:
> Hi list!
> Is there a way to make sure data is being written to physical flash when
> using JFFS2? In other words, After writing a file on a JFFS2 partition, is
> there anything that can be done to make sure that the data is getting
> written to the flash right away? Would "sync" or "fsync" have that effect?
>
> Thanks a lot in advance for any input!!!
>
> Happy weekend,
>
> Patrick
>
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-07-15 16:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-09 23:08 JFFS 2 Question Patrick Hilt
2004-07-10  9:31 ` Mike Wellington
2004-07-10  9:38 ` Brad Campbell
2004-07-10 10:18   ` Thomas Gleixner
2004-07-10 11:50   ` Wolfgang Denk
2004-07-15 16:47 ` Patrick Hilt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox