xfs
[Top] [All Lists]

Re: File corruption

To: Larry Altneu <larry.altneu@xxxxxxxxxxxxxxxxxxxxx>
Subject: Re: File corruption
From: Steve Lord <lord@xxxxxxx>
Date: Tue, 07 Aug 2001 10:51:51 -0500
Cc: "'linux-xfs@xxxxxxxxxxx'" <linux-xfs@xxxxxxxxxxx>
In-reply-to: Message from Larry Altneu <larry.altneu@passengernetworks.com> of "Tue, 07 Aug 2001 08:40:05 PDT." <01B6B159F711D41194B2005004C2905C107628@paxnetworks.com>
Sender: owner-linux-xfs@xxxxxxxxxxx
> I am experiencing a problem that results in corruption of the data for a
> freshly written file. It is very reproducible by creating and saving a file
> with vi and then pulling the plug on the system. When it comes back up, the
> file exists with the proper size but it contains all zeros. Any guidance
> would be appreciated.


If it hurts don't do that!

Basically this is normal behavior. XFS journals metadata updates, not data
updates. After a crash you are supposed to get a consistent filesystem 
which looks like the state sometime shortly before the crash, NOT what
the in memory image looked like the instant before the crash. Since XFS
does not write data out to disk immediately unless you tell it to with
fsync or an O_SYNC open (the same is true of other filesystems), you 
are looking at an inode which was flushed out to disk, but for which the
data was never flushed to disk. You will find that the inode is not
taking any disk space since all it has is a size, there are no disk
blocks allocated for it yet.

Steve




<Prev in Thread] Current Thread [Next in Thread>