[CentOS] Calling All FS Fanatics

Fri Oct 6 15:40:38 UTC 2006
Les Mikesell <lesmikesell at gmail.com>

On Fri, 2006-10-06 at 11:21 +0800, Feizhou wrote:
> > I thought that journalled file systems only had to count on the
> > disk/raid not re-ordering the writes to avoid filesystem corruption.
> > That is, is doesn't matter if the writes are cached as long as what
> > is written is written in the same order as the OS issued the writes.
> > You just lose the data of anything that did not make it to the disk
> > but you shouldn't mess up the relationship between free/allocated
> > space and the inodes using it.  Is that impression incorrect?
> > 
> 
> Journal file systems do not rely on writes not being reordered. They 
> rely on the meta data (directory/inode stuff) being committed to the 
> journal to preserve filesystem integrity. If the meta data was still in 
> the caches whether the raid card cache or the hard disks' cache and not 
> committed to the media, you can expect some directory/inode corruption.

Yes, but what is important is the state of the disk at any time, not
whether it is in sync with what the OS thinks is on it.  You are going
to lose data in any case.  Whether you get filesystem corruption or
not depends only on the metadata changes being handled in the proper
sequence.  If none of the changes make it to disk, the filesystem is
still fine. If the metadata changes are written in the wrong order
or the data change is written first (all very likely with controllers
or drives that cache and optimize the writes) the result will be
corrupted if it doesn't complete.

-- 
  Les Mikesell
   lesmikesell at gmail.com