[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Major JFFS2 bug (?)




Vipin.Malik@xxxxxxx.com said:
> With JFFS2, if you are overwriting data to an existing file and power
> crashes, you may endup with a file that has *some* old data and *some*
> new data.

> The "atomicity" of the write() with respect to power fail is NOT
> guaranteed. I have proved this with JFFS2.

> In my debate with Alan Cox, I argued for power fail safe write()'s. 

Ponder the following situation:
 1. You request a write of 5000 bytes.
 2. JFFS2 writes 4096 bytes of it and returns accordingly.
 3. Power is lost before you can do anything about it or attempt to
	perform a second write call to write the remaining 904 bytes.

Compare with this situation:
 1. You request a write of 5000 bytes.
 2. JFFS2 writes 4096 bytes and is about to write the remainder.
 3. Power is lost before it does so.

What is the difference between the results of those two situations? The
first is perfectly legal. The second you argue is not, and I'm half inclined
to agree with you - but does it actually matter?

--
dwmw2



To unsubscribe from this list: send the line "unsubscribe jffs-dev" in
the body of a message to majordomo@xxxxxxx.com