From: Allison Henderson <allison.henderson@oracle.com>
To: linux-xfs@vger.kernel.org
Subject: [PATCH v25 11/14] xfsprogs: Add log attribute error tag
Date: Tue, 16 Nov 2021 21:16:10 -0700 [thread overview]
Message-ID: <20211117041613.3050252-12-allison.henderson@oracle.com> (raw)
In-Reply-To: <20211117041613.3050252-1-allison.henderson@oracle.com>
This patch adds an error tag that we can use to test log attribute
recovery and replay
Signed-off-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
---
io/inject.c | 1 +
libxfs/defer_item.c | 6 ++++++
libxfs/xfs_errortag.h | 4 +++-
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/io/inject.c b/io/inject.c
index b8b0977e139e..43b51db5b9cc 100644
--- a/io/inject.c
+++ b/io/inject.c
@@ -58,6 +58,7 @@ error_tag(char *name)
{ XFS_ERRTAG_REDUCE_MAX_IEXTENTS, "reduce_max_iextents" },
{ XFS_ERRTAG_BMAP_ALLOC_MINLEN_EXTENT, "bmap_alloc_minlen_extent" },
{ XFS_ERRTAG_AG_RESV_FAIL, "ag_resv_fail" },
+ { XFS_ERRTAG_LARP, "larp" },
{ XFS_ERRTAG_MAX, NULL }
};
int count;
diff --git a/libxfs/defer_item.c b/libxfs/defer_item.c
index 594f5e92e668..5392a1bcb961 100644
--- a/libxfs/defer_item.c
+++ b/libxfs/defer_item.c
@@ -131,6 +131,11 @@ xfs_trans_attr_finish_update(
XFS_ATTR_OP_FLAGS_TYPE_MASK;
int error;
+ if (XFS_TEST_ERROR(false, args->dp->i_mount, XFS_ERRTAG_LARP)) {
+ error = -EIO;
+ goto out;
+ }
+
switch (op) {
case XFS_ATTR_OP_FLAGS_SET:
error = xfs_attr_set_iter(dac);
@@ -144,6 +149,7 @@ xfs_trans_attr_finish_update(
break;
}
+out:
/*
* Mark the transaction dirty, even on error. This ensures the
* transaction is aborted, which:
diff --git a/libxfs/xfs_errortag.h b/libxfs/xfs_errortag.h
index a23a52e643ad..c15d2340220c 100644
--- a/libxfs/xfs_errortag.h
+++ b/libxfs/xfs_errortag.h
@@ -59,7 +59,8 @@
#define XFS_ERRTAG_REDUCE_MAX_IEXTENTS 36
#define XFS_ERRTAG_BMAP_ALLOC_MINLEN_EXTENT 37
#define XFS_ERRTAG_AG_RESV_FAIL 38
-#define XFS_ERRTAG_MAX 39
+#define XFS_ERRTAG_LARP 39
+#define XFS_ERRTAG_MAX 40
/*
* Random factors for above tags, 1 means always, 2 means 1/2 time, etc.
@@ -103,5 +104,6 @@
#define XFS_RANDOM_REDUCE_MAX_IEXTENTS 1
#define XFS_RANDOM_BMAP_ALLOC_MINLEN_EXTENT 1
#define XFS_RANDOM_AG_RESV_FAIL 1
+#define XFS_RANDOM_LARP 1
#endif /* __XFS_ERRORTAG_H_ */
--
2.25.1
next prev parent reply other threads:[~2021-11-17 4:16 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-17 4:15 [PATCH v25 00/14] Log Attribute Replay Allison Henderson
2021-11-17 4:16 ` [PATCH v25 01/14] xfs: allow setting and clearing of log incompat feature flags Allison Henderson
2021-11-17 4:16 ` [PATCH v25 02/14] xfs: add attr state machine tracepoints Allison Henderson
2021-11-17 4:16 ` [PATCH v25 03/14] xfsprogs: Rename __xfs_attr_rmtval_remove Allison Henderson
2021-11-17 4:16 ` [PATCH v25 04/14] xfs: don't commit the first deferred transaction without intents Allison Henderson
2021-11-17 4:16 ` [PATCH v25 05/14] xfsprogs: Return from xfs_attr_set_iter if there are no more rmtblks to process Allison Henderson
2021-11-17 4:16 ` [PATCH v25 06/14] xfsprogs: Set up infrastructure for log attribute replay Allison Henderson
2021-11-17 4:16 ` [PATCH v25 07/14] xfsprogs: Implement attr logging and replay Allison Henderson
2021-11-17 4:16 ` [PATCH v25 08/14] xfsprogs: Skip flip flags for delayed attrs Allison Henderson
2021-11-17 4:16 ` [PATCH v25 09/14] xfsprogs: Add xfs_attr_set_deferred and xfs_attr_remove_deferred Allison Henderson
2021-11-17 4:16 ` [PATCH v25 10/14] xfsprogs: Remove unused xfs_attr_*_args Allison Henderson
2021-11-17 4:16 ` Allison Henderson [this message]
[not found] ` <11E93260-33C2-46BE-82B1-0402CB52BCD4@oracle.com>
2021-11-23 6:44 ` [PATCH v25 11/14] xfsprogs: Add log attribute error tag Allison Henderson
2021-11-17 4:16 ` [PATCH v25 12/14] xfsprogs: Merge xfs_delattr_context into xfs_attr_item Allison Henderson
2021-11-17 4:16 ` [PATCH v25 13/14] xfsprogs: Add helper function xfs_attr_leaf_addname Allison Henderson
2021-11-17 4:16 ` [PATCH v25 14/14] xfsprogs: Add log item printing for ATTRI and ATTRD 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=20211117041613.3050252-12-allison.henderson@oracle.com \
--to=allison.henderson@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;
as well as URLs for NNTP newsgroup(s).