xfs
[Top] [All Lists]

Re: filesize after H/W fault

To: ASANO Masahiro <masano@xxxxxxxxxxxxxx>
Subject: Re: filesize after H/W fault
From: Stephen Lord <lord@xxxxxxx>
Date: 15 Jul 2002 06:01:25 -0500
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <20020715135555H.masano@tnes.nec.co.jp>
References: <20020715135555H.masano@tnes.nec.co.jp>
Sender: owner-linux-xfs@xxxxxxxxxxx
On Sun, 2002-07-14 at 23:55, ASANO Masahiro wrote:
> Hi,
> 
> I have run old xfs on my server machine. The kernel is linux-2.4.7 and
> xfs cvs based. This system was working fine for several months without
> any xfs related troubles. But a problem happened at last.
> 
> After a hardware fault, some files on xfs were truncated to size
> zero. The files were created via nfs v3 several hours before the
> hardware fault, and were not overwritten after created. When the
> filesystem was mounted at reboot, log recovery was done automatically,
> and there was no error.
> 
> I thought file data would be sync'd to disk within minutes after it is
> written. What happened?
> Any ideas or patches?

There is one scenario which can cause this:

        o files are created with data in them, then the filesystem
          goes idle for a long time

        o there is a crash

Because inode size updates are not transactional, and there was no
log activity after the writes to change the log, the tail of the
log is still before the create operations. This gets replayed
on recovery and the size gets reset. If this theory is correct
then you may still have extents in the file with your data
in them.

There is code in the kernel to deal with this scenario, the
xfs_sync path will push an extra record into the log on an
idle filesystem, but it depends on write_super getting called
correctly. This will move the tail of the log forwards and
prevent the replay of the old transactions.

Steve

> 
> --
> Masano



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