All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: "Darrick J. Wong" <djwong@alder.djwong.org>,
	david@fromorbit.com, darrick.wong@oracle.com
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 03/10] xfs_repair: ignore "repaired" flag after we decide to clear xattr block
Date: Mon, 17 Aug 2015 14:20:32 -0500	[thread overview]
Message-ID: <55D23400.7020106@sandeen.net> (raw)
In-Reply-To: <20150815014357.1839.68720.stgit@birch.djwong.org>

On 8/14/15 8:43 PM, Darrick J. Wong wrote:
> If in the course of examining extended attribute block contents we
> first decide to repair an entry (*repair = 1) but secondly decide to
> clear the whole block, set *repair = 0 because the clearing action
> only happens if *repair == 0.  Put another way, if we're nuking a
> block, don't pretend like we've fixed it too.

Hm, or what happens otherwise?

TBH this is making my brain hurt, chasing it all the way back up
the callchain.  It's *repair not *repaired; it's not saying we
fixed it, but that we should fix it, right?  It'll take me a while
to work out what all the callers do with the "clearit" return from
process_attr_leaf_block and with *repair.

Did you have a specific example of something going wrong?

thanks,
-Eric

> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>  repair/attr_repair.c |   14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> 
> diff --git a/repair/attr_repair.c b/repair/attr_repair.c
> index 62f80e7..2bd9334 100644
> --- a/repair/attr_repair.c
> +++ b/repair/attr_repair.c
> @@ -1311,6 +1311,13 @@ process_leaf_attr_block(
>  		* we can add it then.
>  		*/
>  	}
> +	/*
> +	 * If we're just going to zap the block, don't pretend like we
> +	 * repaired it, because repairing the block stops the clear
> +	 * operation.
> +	 */
> +	if (clearit)
> +		*repair = 0;
>  	if (*repair)
>  		xfs_attr3_leaf_hdr_to_disk(mp->m_attr_geo, leaf, &leafhdr);
>  
> @@ -1524,6 +1531,7 @@ process_longform_attr(
>  	xfs_dahash_t	next_hashval;
>  	int		repairlinks = 0;
>  	struct xfs_attr3_icleaf_hdr leafhdr;
> +	int		error;
>  
>  	*repair = 0;
>  
> @@ -1604,12 +1612,16 @@ process_longform_attr(
>  			libxfs_writebuf(bp, 0);
>  		} else
>  			libxfs_putbuf(bp);
> -		return (process_node_attr(mp, ino, dip, blkmap)); /* + repair */
> +		error = process_node_attr(mp, ino, dip, blkmap); /* + repair */
> +		if (error)
> +			*repair = 0;
> +		return error;
>  	default:
>  		do_warn(
>  	_("bad attribute leaf magic # %#x for dir ino %" PRIu64 "\n"),
>  			be16_to_cpu(leaf->hdr.info.magic), ino);
>  		libxfs_putbuf(bp);
> +		*repair = 0;
>  		return(1);
>  	}
>  
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
> 

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

  reply	other threads:[~2015-08-17 19:20 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-15  1:43 [PATCH 00/10] xfsprogs August 2015 patchbomb Darrick J. Wong
2015-08-15  1:43 ` [PATCH 01/10] libxfs: readahead of dir3 data blocks should use the read verifier Darrick J. Wong
2015-08-17 18:31   ` Eric Sandeen
2015-08-17 20:30     ` Darrick J. Wong
2015-08-15  1:43 ` [PATCH 02/10] xfs_db: don't crash on a corrupt inode Darrick J. Wong
2015-08-17 18:52   ` Eric Sandeen
2015-08-17 20:45     ` Darrick J. Wong
2015-08-15  1:43 ` [PATCH 03/10] xfs_repair: ignore "repaired" flag after we decide to clear xattr block Darrick J. Wong
2015-08-17 19:20   ` Eric Sandeen [this message]
2015-08-17 20:50     ` Darrick J. Wong
2015-08-15  1:44 ` [PATCH 04/10] xfs_repair: fix broken EFSBADCRC/EFSCORRUPTED usage with buffer errors Darrick J. Wong
2015-08-17 19:51   ` Eric Sandeen
2015-08-17 19:57     ` Eric Sandeen
2015-08-15  1:44 ` [PATCH 05/10] xfs_repair: force not-so-bad bmbt blocks back through the verifier Darrick J. Wong
2015-08-17 21:14   ` Eric Sandeen
2015-08-17 23:48     ` Darrick J. Wong
2015-08-15  1:44 ` [PATCH 06/10] xfs_repair: mark unreachable prefetched metadata blocks stale Darrick J. Wong
2015-08-15  1:44 ` [PATCH 07/10] xfs_io: support reflinking and deduping file ranges Darrick J. Wong
2015-08-15  1:44 ` [PATCH 08/10] xfs_db: enable blocktrash for checksummed filesystems Darrick J. Wong
2015-08-18 19:26   ` Eric Sandeen
2015-08-19 15:22     ` Darrick J. Wong
2015-08-15  1:44 ` [PATCH 09/10] xfs_db: trash the block at the top of the cursor stack Darrick J. Wong
2015-08-18 19:59   ` Eric Sandeen
2015-08-19 15:12     ` Darrick J. Wong
2015-08-15  1:44 ` [PATCH 10/10] xfs_db: enable blockget for v5 filesystems Darrick J. Wong

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=55D23400.7020106@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=darrick.wong@oracle.com \
    --cc=david@fromorbit.com \
    --cc=djwong@alder.djwong.org \
    --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 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.