From: Qu Wenruo Date: Wed, 24 Apr 2019 07:22:53 +0000 (+0800) Subject: btrfs: tree-checker: Allow error injection for tree-checker X-Git-Tag: v5.15~6154^2~44 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=02529d7a1077c5d00d990143cbd78aa56bb7c7cb;p=platform%2Fkernel%2Flinux-starfive.git 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 Signed-off-by: David Sterba --- diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c index 32eeee5..748cd15 100644 --- a/fs/btrfs/tree-checker.c +++ b/fs/btrfs/tree-checker.c @@ -15,6 +15,9 @@ * carefully reviewed otherwise so it does not prevent mount of valid images. */ +#include +#include +#include #include "ctree.h" #include "tree-checker.h" #include "disk-io.h" @@ -942,6 +945,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 +1009,4 @@ int btrfs_check_node(struct extent_buffer *node) out: return ret; } +ALLOW_ERROR_INJECTION(btrfs_check_node, ERRNO);