summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tree-checker.c
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2019-04-24 03:22:53 -0400
committerDavid Sterba <dsterba@suse.com>2019-04-29 13:02:52 -0400
commit02529d7a1077c5d00d990143cbd78aa56bb7c7cb (patch)
tree3a23bfae92cd76e006859430c54050f8552f689a /fs/btrfs/tree-checker.c
parent51d470aeaa3a4ac5bdf98743ac1d32008e8dafa4 (diff)
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: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/tree-checker.c')
-rw-r--r--fs/btrfs/tree-checker.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
index 32eeee5ec497..748cd1598255 100644
--- a/fs/btrfs/tree-checker.c
+++ b/fs/btrfs/tree-checker.c
@@ -15,6 +15,9 @@
15 * carefully reviewed otherwise so it does not prevent mount of valid images. 15 * carefully reviewed otherwise so it does not prevent mount of valid images.
16 */ 16 */
17 17
18#include <linux/types.h>
19#include <linux/stddef.h>
20#include <linux/error-injection.h>
18#include "ctree.h" 21#include "ctree.h"
19#include "tree-checker.h" 22#include "tree-checker.h"
20#include "disk-io.h" 23#include "disk-io.h"
@@ -942,6 +945,7 @@ int btrfs_check_leaf_full(struct extent_buffer *leaf)
942{ 945{
943 return check_leaf(leaf, true); 946 return check_leaf(leaf, true);
944} 947}
948ALLOW_ERROR_INJECTION(btrfs_check_leaf_full, ERRNO);
945 949
946int btrfs_check_leaf_relaxed(struct extent_buffer *leaf) 950int btrfs_check_leaf_relaxed(struct extent_buffer *leaf)
947{ 951{
@@ -1005,3 +1009,4 @@ int btrfs_check_node(struct extent_buffer *node)
1005out: 1009out:
1006 return ret; 1010 return ret;
1007} 1011}
1012ALLOW_ERROR_INJECTION(btrfs_check_node, ERRNO);