All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: "Darrick J. Wong" <darrick.wong@oracle.com>, sandeen@redhat.com
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 5/5] xfs_repair: trash dirattr btrees that cycle to the root
Date: Mon, 23 Jan 2017 21:03:34 -0600	[thread overview]
Message-ID: <d7b15061-e95b-c09c-234d-6ae22d50bac4@sandeen.net> (raw)
In-Reply-To: <148494394775.5256.15878832693432189642.stgit@birch.djwong.org>

On 1/20/17 2:25 PM, Darrick J. Wong wrote:
> If xfs_repair detects a dir/attr btree that cycles back to the root, the
> tree should be cleared and/or rebuilt instead of simply aborting the
> repair program.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

So, while this seems ok, so:

Reviewed-by: Eric Sandeen <sandeen@redhat.com>

you can take this or leave it:

It'd be a bit nicer to just test da_bno outside the loop, I think;
the whole loop is

	do {
....
        } while (da_bno != 0);

so the only way da_bno can be zero here is if we entered the loop this way
after:

        da_bno = da_cursor->level[0].bno;

prior to entering it the first time:

        ino = da_cursor->ino;
        prev_bno = 0;

        do {
 
-Eric

> ---
>  repair/attr_repair.c |    7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> 
> diff --git a/repair/attr_repair.c b/repair/attr_repair.c
> index b855a10..37a821b 100644
> --- a/repair/attr_repair.c
> +++ b/repair/attr_repair.c
> @@ -763,7 +763,12 @@ process_leaf_attr_level(xfs_mount_t	*mp,
>  		 * 0 is the root block and no block
>  		 * pointer can point to the root block of the btree
>  		 */
> -		ASSERT(da_bno != 0);
> +		if (da_bno == 0) {
> +			do_warn(
> +	_("btree cycle detected in attribute fork for inode %" PRIu64 "\n"),
> +				ino);
> +			goto error_out;
> +		}
>  
>  		if (dev_bno == NULLFSBLOCK) {
>  			do_warn(
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

      reply	other threads:[~2017-01-24  3:03 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-20 20:25 [PATCH 0/5] xfsprogs: miscellaneous cleanups Darrick J. Wong
2017-01-20 20:25 ` [PATCH 1/5] xfs_db: sanitize geometry on load Darrick J. Wong
2017-01-20 23:33   ` Eric Sandeen
2017-01-21  0:15   ` [PATCH v5 " Darrick J. Wong
2017-01-23 20:02     ` Eric Sandeen
2017-01-23 20:35       ` Darrick J. Wong
2017-01-23 21:30     ` Darrick J. Wong
2017-01-23 21:31   ` [PATCH v6 " Darrick J. Wong
2017-01-24 22:38     ` Eric Sandeen
2017-01-24 22:52     ` [PATCH v7 1/5] xfs_db: sanitize agcount " Eric Sandeen
2017-01-25  0:21       ` Darrick J. Wong
2017-01-25  0:55         ` Eric Sandeen
2017-01-25  3:09       ` [PATCH v8 " Eric Sandeen
2017-01-25  4:48         ` Darrick J. Wong
2017-01-26  1:05         ` [PATCH v9 " Eric Sandeen
2017-01-26  1:17           ` [PATCH v10 " Eric Sandeen
2017-01-26  1:27             ` Darrick J. Wong
2017-01-20 20:25 ` [PATCH 2/5] xfs_db: fix the 'source' command when passed as a -c option Darrick J. Wong
2017-01-23 22:29   ` Eric Sandeen
2017-01-23 23:39     ` Darrick J. Wong
2017-01-23 23:41   ` [PATCH v2 " Darrick J. Wong
2017-01-20 20:25 ` [PATCH 3/5] xfs_repair: strengthen geometry checks Darrick J. Wong
2017-01-23 23:47   ` Eric Sandeen
2017-01-24  0:13     ` Darrick J. Wong
2017-01-24  0:29       ` Eric Sandeen
2017-01-24  0:55   ` [PATCH v2 " Darrick J. Wong
2017-01-20 20:25 ` [PATCH 4/5] xfs_repair: zero shared_vn Darrick J. Wong
2017-01-20 22:20   ` Eric Sandeen
2017-01-20 22:51     ` Darrick J. Wong
2017-01-20 22:52   ` [PATCH v2 " Darrick J. Wong
2017-01-20 23:08     ` Eric Sandeen
2017-01-21  0:08       ` Darrick J. Wong
2017-01-21  0:09   ` [PATCH v3 " Darrick J. Wong
2017-01-24  2:38     ` Eric Sandeen
2017-01-20 20:25 ` [PATCH 5/5] xfs_repair: trash dirattr btrees that cycle to the root Darrick J. Wong
2017-01-24  3:03   ` 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=d7b15061-e95b-c09c-234d-6ae22d50bac4@sandeen.net \
    --to=sandeen@sandeen.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.