As long as you can _detect_ that the data was half written (i.e. a 
ECC/CRC/checksum fails on the read), the journelling file system will 
(should!) ignore the last partial write which effectively discards the 
last thing written.  This is as good as you can expect to get and is 
much better than the non-journelling file systems which potentially 
destroys data (worst case, all of the data in that file system) during 
an unexpected power loss.

You do have to be careful: in our (painful) experience, if you write to 
EEPROM or flash chips _while_ the power is going down such that the 
write isn't complete when the power is below the valid threshold, the 
chip can get confused _internally_ and write to RANDOM locations, 
corrupting your file system.  This also happened with early EEPROMs 
before they invented the "software write protect" sequence: if the WR* 
line wasn't qualified by "power valid", the micro could lose its brains 
and scribble in your EEPROM as power went into the invalid 
region.  With software write protect algorithms, it takes a sequence of 
write cycles to initiate an internal write sequence, effectively 
eliminating this problem.

gvb


At 03:00 PM 8/1/01 -0400, you wrote:
>On Wed, Aug 01, 2001 at 10:46:03AM -0700, David Christensen wrote:
> > > I made experiments with reiserfs because I've got the same problem
> > > here. But I learned that also a journaling fs may become corrupt
> > > when power fails (the same with ntfs and embedded nt.)
> >
> > That's troubling. I thought that the whole motivation for a journaling
> > file system was to fix this kind of problem. Were you using the 2.2 or
> > 2.4 kernel series for your testing?
>
>Well, you know, here's the thing.  Perhaps *I've* been missing
>something, but isn't the theory of a journalling filesystem "we can't
>guarantee that the drive channel won't fail while we're trying to write
>your data on the disk... so we'll *write it on the disk first*, just in
>case"?
>
>I've never quite gotten that, myself.
>
>If a drive fails in mid write, then there's *going* to be some data
>half-written, no?
>
>Cheers,
>-- jra
>Jay R. 
>Ashworth                                                [EMAIL PROTECTED]
>Member of the Technical 
>Staff     Baylink                             RFC 2100
>The Suncoast Freenet         The Things I Think
>Tampa Bay, Florida        http://baylink.pitas.com             +1 727 
>804 5015
>
>    "So easy to use, no wonder the Internet is going to hell!"
>      -- me





**********************************************************************
This e-mail and any files transmitted with it are confidential and may
be legally privileged or otherwise exempt from disclosure under
applicable law. This e-mail and its files are intended solely for
the individual or entity to whom they are addressed and their content
is the property of Smiths Aerospace.  If you are not the intended
recipient, please do not read, copy, use or disclose this communication.
If you have received this e-mail in error please notify the e-mail 
administrator at [EMAIL PROTECTED] and then delete this e-mail, its
files and any copies.

This footnote also confirms that this e-mail message has been scanned
for the presence of known computer viruses.
***********************************************************************

--
To unsubscribe from this list, send a message to [EMAIL PROTECTED]
with the command "unsubscribe linux-embedded" in the message body.
For more information, see <http://waste.org/mail/linux-embedded>.

Reply via email to