public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Catherine Hoang <catherine.hoang@oracle.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [RFC PATCH 2/2] xfs: add leaf to node error tag
Date: Fri, 12 Nov 2021 10:24:39 +1100	[thread overview]
Message-ID: <20211111232439.GK449541@dread.disaster.area> (raw)
In-Reply-To: <20211111001716.77336-3-catherine.hoang@oracle.com>

On Thu, Nov 11, 2021 at 12:17:16AM +0000, Catherine Hoang wrote:
> Add an error tag on xfs_attr3_leaf_to_node to test log attribute
> recovery and replay.
> 
> Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>
> ---
>  fs/xfs/libxfs/xfs_attr_leaf.c | 6 ++++++
>  fs/xfs/libxfs/xfs_errortag.h  | 4 +++-
>  fs/xfs/xfs_error.c            | 3 +++
>  3 files changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c
> index 74b76b09509f..fdeb09de74ca 100644
> --- a/fs/xfs/libxfs/xfs_attr_leaf.c
> +++ b/fs/xfs/libxfs/xfs_attr_leaf.c
> @@ -28,6 +28,7 @@
>  #include "xfs_dir2.h"
>  #include "xfs_log.h"
>  #include "xfs_ag.h"
> +#include "xfs_errortag.h"
>  
>  
>  /*
> @@ -1189,6 +1190,11 @@ xfs_attr3_leaf_to_node(
>  
>  	trace_xfs_attr_leaf_to_node(args);
>  
> +	if (XFS_TEST_ERROR(false, mp, XFS_ERRTAG_LEAF_TO_NODE)) {
> +		error = -EIO;
> +		goto out;
> +	}
> +
>  	error = xfs_da_grow_inode(args, &blkno);
>  	if (error)
>  		goto out;
> diff --git a/fs/xfs/libxfs/xfs_errortag.h b/fs/xfs/libxfs/xfs_errortag.h
> index 31aeeb94dd5b..cc1650b58723 100644
> --- a/fs/xfs/libxfs/xfs_errortag.h
> +++ b/fs/xfs/libxfs/xfs_errortag.h
> @@ -61,7 +61,8 @@
>  #define XFS_ERRTAG_AG_RESV_FAIL				38
>  #define XFS_ERRTAG_LARP					39
>  #define XFS_ERRTAG_LEAF_SPLIT				40
> -#define XFS_ERRTAG_MAX					41
> +#define XFS_ERRTAG_LEAF_TO_NODE				41
> +#define XFS_ERRTAG_MAX					42

Same again about naming. THis is an attribute fork injection point,
not a generic "leaf-to-node" error injection point.

Whihc makes me wonder: this is testing just the initial leaf split
shape change. There are other shape changes - inline -> leaf, leaf
-> multi-level tree (xfs_da3_split()) and multi-level -> single
level leaf, leaf -> inline - for the attr tree, and there are even
more shape changes for the directory tree (inline, leaf, leafN,
node)

As a general infrastructure question, are we really going to now add
separate error injections for each different shape change on each
different type of btree? That explodes the number of injection
points quite quickly....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  parent reply	other threads:[~2021-11-11 23:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-11  0:17 [RFC PATCH 0/2] xfs: add error tags for log attribute replay test Catherine Hoang
2021-11-11  0:17 ` [RFC PATCH 1/2] xfs: add leaf split error tag Catherine Hoang
2021-11-11 16:05   ` Darrick J. Wong
2021-11-11 23:17   ` Dave Chinner
2021-11-12 22:24     ` Allison Henderson
2021-11-11  0:17 ` [RFC PATCH 2/2] xfs: add leaf to node " Catherine Hoang
2021-11-11 16:07   ` Darrick J. Wong
2021-11-11 23:24   ` Dave Chinner [this message]
2021-11-12 22:24     ` Allison Henderson

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=20211111232439.GK449541@dread.disaster.area \
    --to=david@fromorbit.com \
    --cc=catherine.hoang@oracle.com \
    --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