public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: "SCHEFFER, Philippe" <Philippe.SCHEFFER@inist.fr>
Cc: "xfs@oss.sgi.com" <xfs@oss.sgi.com>
Subject: Re: RE : xfs_repair fails with corrupt dinode
Date: Fri, 30 Jan 2015 16:52:32 +1100	[thread overview]
Message-ID: <20150130055232.GB4251@dastard> (raw)
In-Reply-To: <587A9635632B174A943E53AF3B58A9082E3C81A6FB@vanda>

On Fri, Jan 30, 2015 at 01:42:07AM +0100, SCHEFFER, Philippe wrote:
> xfs_repair -p log in attached file.
> 
> Philippe
> ________________________________________
> De : Dave Chinner [david@fromorbit.com]
> Date d'envoi : vendredi 30 janvier 2015 00:15
> À : SCHEFFER, Philippe
> Cc : xfs@oss.sgi.com
> Objet : Re: xfs_repair fails with corrupt dinode
> 
> On Thu, Jan 29, 2015 at 04:48:15PM +0100, SCHEFFER, Philippe wrote:
> > Hi,
> >
> > I have a corrupted xfs filesytem. When I try to repair I get this error :
> > disconnected inode 1427919, moving to lost+found
> > corrupt dinode 1427919, extent total = 1, nblocks = 0.  This is a bug.
> > Please capture the filesystem metadata with xfs_metadump and
> > report it to xfs@oss.sgi.com.
> > cache_node_purge: refcount was 1, not zero (node=0x1f6c19620)
> >
> > fatal error -- 117 - couldn't iget disconnected inode
> >
> > I captured metada with xfs_metadump but the file is 1,4Gb long. I can't send it to you.
> >
> > I printed inode1427919 :
> >
> > xfs_db> inode 1427919
> > xfs_db> print
> > core.magic = 0x494e
> ....
> > core.format = 2 (extents)
> ....
> > core.size = 2536
> > core.nblocks = 1
> > core.extsize = 0
> > core.nextents = 1
> ....
> > u.bmx[0] = [startoff,startblock,blockcount,extentflag] 0:[0,320660992,1,0]
> 
> That's an inode with one extent of one block and looks perfectly
> valid. We'll need the entire output of the xfs_repair run to see if
> there were any prior actions taken on that inode by xfs_repair....

As i pointed out to Brian on IRC earlier:

data fork in regular inode 1427919 claims used block 320660992
correcting nblocks for inode 1427919, was 1 - counted 0

So it looks like the inode has a cross linked block, repair dropped
the block count by that one block, and then failed to remove the
extent from the inode. So, a repair bug, that was...

commit e1f43b4c701b24d9b5bc85df858a8c36f0f0723b
Author: Christoph Hellwig <hch@infradead.org>
Date:   Thu Feb 2 07:39:10 2012 -0500

    repair: update extent count after zapping duplicate blocks
    
    When we find a duplicate extent in an extern format inode we do not zap
    the whole inode, but just truncate it to the point where the duplicate
    extent was found.  But the current code only updates di_nblocks for the
    new size, but no di_nextents/di_anextents.  In most cases this isn't noticed,
    but when moving such an inode to the lost+found directoy the consistency
    check in xfs_iformat trips over it.  Fix this by updating the on-disk
    extent count as part of the inode repair.
    
    Note that we zap btree format inodes with duplicate block completely
    at this point, so this fix doesn't apply to them.
    
    Reviewed-by: Mark Tinguely <tinguely@sgi.com>
    Reported-by: Arkadiusz Mi??kiewicz <arekm@maven.pl>
    Tested-by: Arkadiusz Mi??kiewicz <arekm@maven.pl>
    Signed-off-by: Christoph Hellwig <hch@lst.de>

.... fixed the 3 years ago. Upgrade your xfsprogs package and the
problem should go away.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

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

  parent reply	other threads:[~2015-01-30  5:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-29 15:48 xfs_repair fails with corrupt dinode SCHEFFER, Philippe
2015-01-29 17:34 ` Brian Foster
     [not found]   ` <587A9635632B174A943E53AF3B58A9082E3BE068D0@vanda>
2015-01-29 22:56     ` RE : " Brian Foster
2015-01-29 23:45       ` Dave Chinner
2015-01-30  0:27         ` Brian Foster
2015-01-29 23:15 ` Dave Chinner
     [not found]   ` <587A9635632B174A943E53AF3B58A9082E3C81A6FB@vanda>
2015-01-30  5:52     ` Dave Chinner [this message]
2015-01-30 14:37       ` RE : RE : " SCHEFFER, Philippe

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=20150130055232.GB4251@dastard \
    --to=david@fromorbit.com \
    --cc=Philippe.SCHEFFER@inist.fr \
    --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