From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH] btrfs: tree-checker: Allow error injection for tree-checker
Date: Wed, 24 Apr 2019 15:22:53 +0800 [thread overview]
Message-ID: <20190424072253.4979-1-wqu@suse.com> (raw)
Allowing error injection for btrfs_check_leaf_full() and
btrfs_check_node() is useful to test the failure path of btrfs write
time tree check.
Signed-off-by: Qu Wenruo <wqu@suse.com>
---
fs/btrfs/tree-checker.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
index b9dd2a6e133f..9c22a1fe38c1 100644
--- a/fs/btrfs/tree-checker.c
+++ b/fs/btrfs/tree-checker.c
@@ -15,6 +15,7 @@
* carefully reviewed otherwise so it does not prevent mount of valid images.
*/
+#include <linux/error-injection.h>
#include "ctree.h"
#include "tree-checker.h"
#include "disk-io.h"
@@ -942,6 +943,7 @@ int btrfs_check_leaf_full(struct extent_buffer *leaf)
{
return check_leaf(leaf, true);
}
+ALLOW_ERROR_INJECTION(btrfs_check_leaf_full, ERRNO);
int btrfs_check_leaf_relaxed(struct extent_buffer *leaf)
{
@@ -1005,3 +1007,4 @@ int btrfs_check_node(struct extent_buffer *node)
out:
return ret;
}
+ALLOW_ERROR_INJECTION(btrfs_check_node, ERRNO);
--
2.21.0
next reply other threads:[~2019-04-24 7:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-24 7:22 Qu Wenruo [this message]
2019-04-24 17:32 ` [PATCH] btrfs: tree-checker: Allow error injection for tree-checker David Sterba
2019-04-24 17:45 ` David Sterba
2019-04-25 0:30 ` Qu Wenruo
2019-04-25 14:13 ` David Sterba
2019-04-25 14:22 ` Qu Wenruo
2019-04-25 15:13 ` David Sterba
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=20190424072253.4979-1-wqu@suse.com \
--to=wqu@suse.com \
--cc=linux-btrfs@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 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.