[Top] [All Lists]

Re: wishlist: xfs_repair should detect files with too small sizes

To: xfs@xxxxxxxxxxx
Subject: Re: wishlist: xfs_repair should detect files with too small sizes
From: Andras Korn <korn-xfs@xxxxxxxxxxxxxx>
Date: Thu, 16 May 2013 05:56:51 +0200
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20130515214105.GZ24635@dastard>
References: <20130514215550.GK17260@hellgate> <20130515004736.GM29466@dastard> <20130515080355.GL17260@hellgate> <20130515214105.GZ24635@dastard>
User-agent: Mutt/1.5.21 (2010-09-15)
On Thu, May 16, 2013 at 07:41:05AM +1000, Dave Chinner wrote:

> > OK, thinking about it I realise there doesn't appear to be a good way of
> > preventing the problem, but I'm still not sure some heuristic couldn't be
> > invented to detect and partially remedy it after the fact.
> Trying to remedy it in xfs_repair does more harm than good. What
> happens now allows recovery of data if the inode size was wrong. If
> we remove the blocks beyond EOF, we lose that ability and hence make
> unrecoverable data loss more likely in common failure scenarios.

That's clear (xfs_repair not freeing up the space is what allowed me to
recover the data). I meant "remedy" as in _either_ increase the inode size
OR free up the extra space. Perhaps xfs_db could be extended to do this?

Of course, increasing the size as stored in the inode can add garbage (at
the very least, binary zeroes) to the end of files, but if the data would
otherwise have been lost, this is probably still preferable. I can even
imagine an xfs_db command that increases file size up to the last non-zero
data byte in the allocated space.

                     Andras Korn <korn at elan.rulez.org>
                    No wanna work. Wanna bang on keyboard.

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