Re: scary ext2 filesystem question

Kurt Garloff (K.Garloff@ping.de)
Sat, 26 Dec 1998 00:31:17 +0100


On Fri, Dec 25, 1998 at 11:42:57AM -0500, Mirian Crzig Lennox wrote:
> I was reading a book on filesystem design, and came across the
> following scary quote:
>
> "The main difference between ext2 and FFS is that ext2 makes no
> guarantee about consistency of the file system or whether an operation
> is permanently on the disk when the file system call completes.
> [...] This consistency model is not without drawbacks and may not be
> appropriate at all for some applications. Because ext2 makes no
> guarantee about the order of operations and when they are flushed to
> disk, it is conceivable (although unlikely) that later modifications
> to the file system would be recorded on disk but earlier operations
> would not be. Although the file system consistency check would
> ensure that the file system is consistent, the lack of ordering on
> operations can lead to confused applications or, even worse, crashing
> applications because of the inconsistencies in the order of
> modifications to the file system."
> _Practical File System Design_, Dominic Giampaolo, p. 36

Nonsense!
The ext2fs uses write cacheing, like any powerful filesystem does.
This cannot confuse any program. Any program that reads data from the disk
goes through the page cache, so it get's the recent data, whether it was
wriotten to disk yet, or not yet. It is guaranteed to be written to disk
sometime, thats what bdflush/update and kswapd are for. Un unmounting the fs
all buffers are flushed, even if you managed to kill your bdflush before.

You can design an application to get confused, if you really want to: Write
data to a disk using a filesystem on the normal disk device (/dev/sdX) and
try to read it back via raw SCSI commands to /dev/sgX. You can do fancy
things, if you are root, really!

I noted the name of the author in my ignore list ... obviuosly he did not
understand anything!

-- 
Kurt Garloff <kurt@garloff.de>                         [Dortmund, FRG]  
Plasma physics, high perf. computing            [Linux-ix86,-axp, DUX]
PGP key on http://www.garloff.de/kurt/      [Linux SCSI driver: DC390]

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/