linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: John Jore <john@jore.no>,
	"linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>
Subject: Re: Bug in xfs_repair 5..4.0 / Unable to repair metadata corruption
Date: Mon, 10 Feb 2020 09:35:30 -0600	[thread overview]
Message-ID: <e3779a8f-ea4d-b5d2-db3c-6c07f0181f8d@sandeen.net> (raw)
In-Reply-To: <cc20b7f7-a8bf-2654-2609-4571ddb1992b@sandeen.net>

On 2/10/20 8:43 AM, Eric Sandeen wrote:
>> John Jore wrote:

...

>>>> Any suggestions or additional data I can provide?
>>>
>>> If you are willing to provide an xfs_metadump to me (off-list) I will see if I can
>>> reproduce it from the metadump. 
>>>
>>> # xfs_metadump /dev/$WHATEVER metadump.img
>>> # bzip2 metadump.img
> 
> Thanks for providing this offline, I'll take a look.

Ok, so the problem is that you have a whole chunk of inodes that is nothing but
zeros; you can see this with:

# xfs_db -r -c "fsblock 1140850974" -c "type data" -c "p" /dev/$WHATEVER

where fsblock 1140850974 is the location of the bad section of inodes.
How that happened, nobody knows, but that's the corruption that's being detected.

So the problem here is that we added a new test to the inode verifiers, which
validates the next_unlinked field of the inode; this got inherited from kernelspace:

commit 2949b46779cf054a7f9067000bbadf35e55b3ce7
Author: Darrick J. Wong <darrick.wong@oracle.com>
Date:   Wed Apr 18 14:46:07 2018 -0500

    xfs: don't accept inode buffers with suspicious unlinked chains
    
    Source kernel commit: 6a96c5650568a2218712d43ec16f3f82296a6c53
    
    When we're verifying inode buffers, sanity-check the unlinked pointer.
    We don't want to run the risk of trying to purge something that's
    obviously broken.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
    Reviewed-by: Brian Foster <bfoster@redhat.com>
    Signed-off-by: Eric Sandeen <sandeen@redhat.com>

so we now have a test for a valid next unlinked field when we write the inodes,
but we never reset it in repair, so the write verifier fails, and the modified
inodes do not get written back to disk.

I'll send a patch to fix this for this for review, and cc: you, in a moment.

-Eric





      reply	other threads:[~2020-02-10 15:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <186d30f217e645728ad1f34724cbe3e7@jore.no>
2020-02-09  6:19 ` Bug in xfs_repair 5..4.0 / Unable to repair metadata corruption John Jore
2020-02-10  3:47   ` Eric Sandeen
2020-02-10  3:49     ` Eric Sandeen
     [not found]       ` <60f32c031f4345a2b680fbc8531f7bd3@jore.no>
2020-02-10 10:33         ` John Jore
2020-02-10 14:36         ` Eric Sandeen
2020-02-10 14:43     ` Eric Sandeen
2020-02-10 15:35       ` Eric Sandeen [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=e3779a8f-ea4d-b5d2-db3c-6c07f0181f8d@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=john@jore.no \
    --cc=linux-xfs@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).