Commit 02529d7a authored by Qu Wenruo's avatar Qu Wenruo Committed by David Sterba

btrfs: tree-checker: Allow error injection for tree-checker

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: default avatarQu Wenruo <wqu@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 51d470ae
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
* carefully reviewed otherwise so it does not prevent mount of valid images. * carefully reviewed otherwise so it does not prevent mount of valid images.
*/ */
#include <linux/types.h>
#include <linux/stddef.h>
#include <linux/error-injection.h>
#include "ctree.h" #include "ctree.h"
#include "tree-checker.h" #include "tree-checker.h"
#include "disk-io.h" #include "disk-io.h"
...@@ -942,6 +945,7 @@ int btrfs_check_leaf_full(struct extent_buffer *leaf) ...@@ -942,6 +945,7 @@ int btrfs_check_leaf_full(struct extent_buffer *leaf)
{ {
return check_leaf(leaf, true); return check_leaf(leaf, true);
} }
ALLOW_ERROR_INJECTION(btrfs_check_leaf_full, ERRNO);
int btrfs_check_leaf_relaxed(struct extent_buffer *leaf) int btrfs_check_leaf_relaxed(struct extent_buffer *leaf)
{ {
...@@ -1005,3 +1009,4 @@ int btrfs_check_node(struct extent_buffer *node) ...@@ -1005,3 +1009,4 @@ int btrfs_check_node(struct extent_buffer *node)
out: out:
return ret; return ret;
} }
ALLOW_ERROR_INJECTION(btrfs_check_node, ERRNO);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment