linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Eric Sandeen <sandeen@redhat.com>, xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH] xfs_repair: always release btree buffers when refcountbt checks fail
Date: Thu, 9 Nov 2017 13:01:20 +1100	[thread overview]
Message-ID: <20171109020119.GJ4094@dastard> (raw)
In-Reply-To: <20171108002636.GD26910@magnolia>

On Tue, Nov 07, 2017 at 04:26:36PM -0800, Darrick J. Wong wrote:
> During phase 4 of repair, we compare the refcount records we've computed
> against what's in the refcount btree.  If the btree is corrupt the
> libxfs refcount calls will fail, but on our way out of the function we
> don't make sure to clear all the btree cursor's buffer pointers.  This
> leads to a repair deadlock in xfs/372 when fuzzing ptrs[1] to -1U
> because we forgot to release a buffer.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>  repair/rmap.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/repair/rmap.c b/repair/rmap.c
> index 01d6f0f..d51590b 100644
> --- a/repair/rmap.c
> +++ b/repair/rmap.c
> @@ -1359,7 +1359,8 @@ _("Incorrect reference count: saw (%u/%u) len %u nlinks %u; should be (%u/%u) le
>  
>  err:
>  	if (bt_cur)
> -		libxfs_btree_del_cursor(bt_cur, XFS_BTREE_NOERROR);
> +		libxfs_btree_del_cursor(bt_cur, error ? XFS_BTREE_ERROR :
> +							XFS_BTREE_NOERROR);

Looks fine.

Reviewed-by: Dave Chinner <dchinner@redhat.com>

-- 
Dave Chinner
david@fromorbit.com

      reply	other threads:[~2017-11-09  2:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-08  0:26 [PATCH] xfs_repair: always release btree buffers when refcountbt checks fail Darrick J. Wong
2017-11-09  2:01 ` 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=20171109020119.GJ4094@dastard \
    --to=david@fromorbit.com \
    --cc=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@redhat.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;
as well as URLs for NNTP newsgroup(s).