linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Allison Henderson <allison.henderson@oracle.com>
To: linux-xfs@vger.kernel.org
Subject: [PATCH 18/18] xfs: Add delayed attributes error tag
Date: Wed, 18 Apr 2018 15:11:26 -0700	[thread overview]
Message-ID: <1524089486-22922-19-git-send-email-allison.henderson@oracle.com> (raw)
In-Reply-To: <1524089486-22922-1-git-send-email-allison.henderson@oracle.com>

This patch adds an error tag that we can use to test
delayed attribute recovery and replay

Signed-off-by: Allison Henderson <allison.henderson@oracle.com>
---
 fs/xfs/libxfs/xfs_errortag.h | 5 ++++-
 fs/xfs/xfs_error.c           | 3 +++
 fs/xfs/xfs_trans_attr.c      | 8 ++++++++
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/fs/xfs/libxfs/xfs_errortag.h b/fs/xfs/libxfs/xfs_errortag.h
index bc1789d..f606ab6 100644
--- a/fs/xfs/libxfs/xfs_errortag.h
+++ b/fs/xfs/libxfs/xfs_errortag.h
@@ -65,7 +65,8 @@
 #define XFS_ERRTAG_LOG_BAD_CRC				29
 #define XFS_ERRTAG_LOG_ITEM_PIN				30
 #define XFS_ERRTAG_BUF_LRU_REF				31
-#define XFS_ERRTAG_MAX					32
+#define XFS_ERRTAG_DELAYED_ATTR			32
+#define XFS_ERRTAG_MAX					33
 
 /*
  * Random factors for above tags, 1 means always, 2 means 1/2 time, etc.
@@ -102,5 +103,7 @@
 #define XFS_RANDOM_LOG_BAD_CRC				1
 #define XFS_RANDOM_LOG_ITEM_PIN				1
 #define XFS_RANDOM_BUF_LRU_REF				2
+#define XFS_RANDOM_DELAYED_ATTR			1
 
 #endif /* __XFS_ERRORTAG_H_ */
+
diff --git a/fs/xfs/xfs_error.c b/fs/xfs/xfs_error.c
index a63f508..0752f20 100644
--- a/fs/xfs/xfs_error.c
+++ b/fs/xfs/xfs_error.c
@@ -61,6 +61,7 @@ static unsigned int xfs_errortag_random_default[] = {
 	XFS_RANDOM_LOG_BAD_CRC,
 	XFS_RANDOM_LOG_ITEM_PIN,
 	XFS_RANDOM_BUF_LRU_REF,
+	XFS_RANDOM_DELAYED_ATTR,
 };
 
 struct xfs_errortag_attr {
@@ -167,6 +168,7 @@ XFS_ERRORTAG_ATTR_RW(drop_writes,	XFS_ERRTAG_DROP_WRITES);
 XFS_ERRORTAG_ATTR_RW(log_bad_crc,	XFS_ERRTAG_LOG_BAD_CRC);
 XFS_ERRORTAG_ATTR_RW(log_item_pin,	XFS_ERRTAG_LOG_ITEM_PIN);
 XFS_ERRORTAG_ATTR_RW(buf_lru_ref,	XFS_ERRTAG_BUF_LRU_REF);
+XFS_ERRORTAG_ATTR_RW(delayed_attr,	XFS_ERRTAG_DELAYED_ATTR);
 
 static struct attribute *xfs_errortag_attrs[] = {
 	XFS_ERRORTAG_ATTR_LIST(noerror),
@@ -201,6 +203,7 @@ static struct attribute *xfs_errortag_attrs[] = {
 	XFS_ERRORTAG_ATTR_LIST(log_bad_crc),
 	XFS_ERRORTAG_ATTR_LIST(log_item_pin),
 	XFS_ERRORTAG_ATTR_LIST(buf_lru_ref),
+	XFS_ERRORTAG_ATTR_LIST(delayed_attr),
 	NULL,
 };
 
diff --git a/fs/xfs/xfs_trans_attr.c b/fs/xfs/xfs_trans_attr.c
index d02dcb7..3492c5d 100644
--- a/fs/xfs/xfs_trans_attr.c
+++ b/fs/xfs/xfs_trans_attr.c
@@ -35,6 +35,8 @@
 #include "xfs_inode.h"
 #include "xfs_icache.h"
 #include "xfs_quota.h"
+#include "xfs_errortag.h"
+#include "xfs_error.h"
 
 /*
  * This routine is called to allocate an "extent free done"
@@ -109,6 +111,11 @@ xfs_trans_attr(
 	if (error)
 		return error;
 
+	if (XFS_TEST_ERROR(false, ip->i_mount, XFS_ERRTAG_DELAYED_ATTR)) {
+		error = -EIO;
+		goto out;
+	}
+
 	switch (op_flags) {
 		case XFS_ATTR_OP_FLAGS_SET:
 			args.op_flags |= XFS_DA_OP_ADDNAME;
@@ -123,6 +130,7 @@ xfs_trans_attr(
 			error = -EFSCORRUPTED;
 	}
 
+out:
 	if (error) {
 		xfs_defer_cancel(&dfops);
 	        if (leaf_bp)
-- 
2.7.4


      parent reply	other threads:[~2018-04-18 22:13 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-18 22:11 [PATCH 00/18] Parent Pointers v5 Allison Henderson
2018-04-18 22:11 ` [PATCH 01/18] xfs: Move fs/xfs/xfs_attr.h to fs/xfs/libxfs/xfs_attr.h Allison Henderson
2018-05-04 22:18   ` Darrick J. Wong
2018-04-18 22:11 ` [PATCH 02/18] xfs: Add attibute set and remove helper functions Allison Henderson
2018-05-04 22:36   ` Darrick J. Wong
2018-05-05  5:15     ` Allison Henderson
2018-04-18 22:11 ` [PATCH 03/18] xfs: Set up infastructure for deferred attribute operations Allison Henderson
2018-04-18 22:11 ` [PATCH 04/18] xfs: Add xfs_attr_set_deferred and xfs_attr_remove_deferred Allison Henderson
2018-04-18 22:11 ` [PATCH 05/18] xfs: Remove all strlen calls in all xfs_attr_* functions for attr names Allison Henderson
2018-04-18 22:11 ` [PATCH 06/18] xfs: get directory offset when adding directory name Allison Henderson
2018-04-18 22:11 ` [PATCH 07/18] xfs: get directory offset when removing " Allison Henderson
2018-04-18 22:11 ` [PATCH 08/18] xfs: get directory offset when replacing a " Allison Henderson
2018-04-18 22:11 ` [PATCH 09/18] xfs: add parent pointer support to attribute code Allison Henderson
2018-04-18 22:11 ` [PATCH 10/18] xfs: define parent pointer xattr format Allison Henderson
2018-04-18 22:11 ` [PATCH 11/18] xfs: extent transaction reservations for parent attributes Allison Henderson
2018-04-18 22:11 ` [PATCH 12/18] xfs: parent pointer attribute creation Allison Henderson
2018-04-18 22:11 ` [PATCH 13/18] xfs: add parent attributes to link Allison Henderson
2018-04-18 22:11 ` [PATCH 14/18] xfs: remove parent pointers in unlink Allison Henderson
2018-04-18 22:11 ` [PATCH 15/18] xfs: Add parent pointers to rename Allison Henderson
2018-04-18 22:11 ` [PATCH 16/18] xfs: Add the parent pointer support to the superblock version 5 Allison Henderson
2018-04-18 22:11 ` [PATCH 17/18] xfs: Add parent pointer ioctl Allison Henderson
2018-04-18 22:11 ` Allison Henderson [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=1524089486-22922-19-git-send-email-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).