public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: kadafax@gmail.com
Cc: xfs@oss.sgi.com
Subject: Re: XFS, empty files after a crash
Date: Tue, 28 Feb 2012 12:39:25 +1100	[thread overview]
Message-ID: <20120228013924.GT3592@dastard> (raw)
In-Reply-To: <4F4B423E.2000409@gmail.com>

On Mon, Feb 27, 2012 at 09:43:42AM +0100, kadafax@gmail.com wrote:
> Le 27/02/12 02:04, Dave Chinner a écrit :
> >On Tue, Feb 21, 2012 at 01:01:43PM +0100, kfx wrote:
> >># du  myfile
> >>27460    myfile
> >>
> >># du --apparent-size myfile
> >>0    myfile
> >>
> >># xfs_bmap myfile
> >>myfile: no extents
> >That doesn't seem right:
> >
> >$ ls -l foobar
> >-rw------- 1 root root 0 Feb 27 11:54 foobar
> >$ du foobar
> >1024    foobar
> >$ du --apparent-size foobar
> >0       foobar
> >$ xfs_bmap foobar
> >foobar:
> >	0: [0..2047]: 255169872..255171919
> >
> >So xfs_bmap can and does report extents beyond EOF.
> >
> >du uses the fstat(2) syscall to get the block count from the inode,
> >so it's seeing an inode with a block count but no extents. Can you
> >dump the inode via xfs_db like so:
.....
> [root@server 1_out]# xfs_db -r -c "inode 114748" -c p /dev/sdc1
> core.magic = 0x494e
> core.mode = 0100644
> core.version = 2
> core.format = 2 (extents)
.....
> core.size = 0
> core.nblocks = 6460
> core.extsize = 0
> core.nextents = 1
.....
> core.prealloc = 0
....
> core.extsz = 0
> core.extszinherit = 0
....
> u.bmx[0] = [startoff,startblock,blockcount,extentflag]
> 0:[0,1881705728,6460,0]

Ok, so there's an extent there, but xfs_bmap is not showing it
because it isn't a preallocation but rather a normal extent. What
this indicates is that the inode size was not updated on disk after
the data write had occurred.

Given you are running 2.6.38 (the unbuntu kernel), this is likely
caused by a known bug introduced in 2.6.37 by VFS changes outside
XFS to prevent sync livelocks. That has been fixed in current 3.0.x
stable kernels and more recent 3.2+ kernels.  I'd suggest upgrading
your kernel.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

      reply	other threads:[~2012-02-28  1:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-21 12:01 XFS, empty files after a crash kfx
2012-02-21 16:25 ` Peter Grandi
2012-02-22  3:18   ` Eric Sandeen
2012-02-23 19:38     ` Nathaniel W. Turner
2012-02-23 20:07       ` kadafax
2012-02-23 22:15         ` Nathaniel W. Turner
2012-02-24 10:21           ` kadafax
2012-02-21 17:39 ` Stan Hoeppner
2012-02-27  1:04 ` Dave Chinner
2012-02-27  8:43   ` kadafax
2012-02-28  1:39     ` Dave Chinner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120228013924.GT3592@dastard \
    --to=david@fromorbit.com \
    --cc=kadafax@gmail.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox