linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: David Shaw <dshaw@jabberwocky.com>
Cc: list@jonas-server.de, Emmanuel Florac <eflorac@intellique.com>,
	Brian Foster <bfoster@redhat.com>,
	linux-xfs@vger.kernel.org
Subject: Re: [PATCH] xfs: don't crash on unexpected holes in dir/attr btrees
Date: Tue, 20 Jun 2017 09:20:32 -0700	[thread overview]
Message-ID: <20170620162032.GC4740@birch.djwong.org> (raw)
In-Reply-To: <8076750C-88B9-4E8E-BAFE-332222BCD7C7@jabberwocky.com>

On Tue, Jun 20, 2017 at 09:01:11AM -0400, David Shaw wrote:
> On Jun 16, 2017, at 1:53 PM, Darrick J. Wong <darrick.wong@oracle.com> wrote:
> > 
> > Hi all,
> > 
> > So I /think/ the xfs_attr_inactive crashes that both of you have been
> > seeing are a result of XFS assuming that there aren't ever any mapping
> > holes in the extended attribute fork and crashing when it tries to
> > grab a buffer for the hole and fails to notice that holes don't have
> > buffers.  This lightly tested patch gets rid of /that/ problem.
> > 
> > So, if you're willing, can you try this out and see if the crashes go
> > away?  Granted, this might only enable us to lurch on whatever's next...
> 
> I can give this a try.
> 
> Now that you have an idea of what caused the issue, is there some way
> to (easily or not) reproduce it, ideally in userspace?  Part of the
> problem we're having is that we can't reproduce it on a test machine
> so are forced to wait for it to happen in the field under load, where
> it inconveniences users.

I know what caused the crash, but I don't know what caused the hole in
the xattr fork that caused the crash.  It would appear that the xattr
hash tree contains a pointer to an xattr fork offset that is no longer
mapped, but I don't know how we end up with a dangling pointer --
whether this is corruption going on in the attribute fork, or merely a
bug in the routine that tears down the attribute fork and accidentally
tries to delete something twice.

Unfortunately, the metadumps you've both sent me don't seem to contain
any inodes with sparse attribute forks, so evidently something cleaned
up the filesystem before the metadump was taken.

It might help to know a little more about what's going on with the
xattrs that are being attached to those files.  A fair number of the
inodes seem to have extended attributes with 2k values attached.  Does
your workload involve adding and deleting a large number of xattrs?  A
number of large xattrs?  A large number of large xattrs?

That said, if we're tearing down the inode anyway, maybe it doesn't
matter if there's a hole in the map, seeing as the attr_inactive
function already knows how to handle holes and the blocks are all
getting freed anyway.

--D

> 
> David
> 

  reply	other threads:[~2017-06-20 16:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-16 17:53 [PATCH] xfs: don't crash on unexpected holes in dir/attr btrees Darrick J. Wong
2017-06-16 18:12 ` Eric Sandeen
2017-06-20  9:06   ` Christoph Hellwig
2017-06-26 16:04     ` Darrick J. Wong
2017-06-20 13:01 ` David Shaw
2017-06-20 16:20   ` Darrick J. Wong [this message]
2017-07-06 21:59     ` David Shaw

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=20170620162032.GC4740@birch.djwong.org \
    --to=darrick.wong@oracle.com \
    --cc=bfoster@redhat.com \
    --cc=dshaw@jabberwocky.com \
    --cc=eflorac@intellique.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=list@jonas-server.de \
    /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).