xfs
[Top] [All Lists]

Re: File corruption

To: Larry Altneu <larry.altneu@xxxxxxxxxxxxxxxxxxxxx>
Subject: Re: File corruption
From: Eric Sandeen <sandeen@xxxxxxx>
Date: 07 Aug 2001 10:50:56 -0500
Cc: "'linux-xfs@xxxxxxxxxxx'" <linux-xfs@xxxxxxxxxxx>
In-reply-to: <01B6B159F711D41194B2005004C2905C107628@xxxxxxxxxxxxxxx>
References: <01B6B159F711D41194B2005004C2905C107628@xxxxxxxxxxxxxxx>
Sender: owner-linux-xfs@xxxxxxxxxxx
On 07 Aug 2001 08:40:05 -0700, Larry Altneu wrote:
> 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. 

Don't do that.  :)

> When it comes back up, the
> file exists with the proper size but it contains all zeros. Any guidance
> would be appreciated.

As long as there is any form of write caching, writing to a file and
immediately pulling the plug will result in lost data.  The reason you
see the zeros is that the metadata (i.e. file size) has made it to the
transaction log, but the data itself has not made it to disk.  When xfs
is remounted, it replays the log - and you wind up with a file that has
a size, but no data.  So you get zeros.

-Eric

-- 
Eric Sandeen      XFS for Linux     http://oss.sgi.com/projects/xfs
sandeen@xxxxxxx   SGI, Inc.


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