summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorJosef Bacik2017-09-29 21:43:50 +0200
committerDavid Sterba2017-10-30 12:28:00 +0100
commitfd708b81d972a0714b02a60eb4792fdbf15868c4 (patch)
tree218197c736b2e9755f3f31796f46102a56400082 /fs/btrfs/ctree.h
parentbtrfs: pass root to various extent ref mod functions (diff)
downloadkernel-qcow2-linux-fd708b81d972a0714b02a60eb4792fdbf15868c4.tar.gz
kernel-qcow2-linux-fd708b81d972a0714b02a60eb4792fdbf15868c4.tar.xz
kernel-qcow2-linux-fd708b81d972a0714b02a60eb4792fdbf15868c4.zip
Btrfs: add a extent ref verify tool
We were having corruption issues that were tied back to problems with the extent tree. In order to track them down I built this tool to try and find the culprit, which was pretty successful. If you compile with this tool on it will live verify every ref update that the fs makes and make sure it is consistent and valid. I've run this through with xfstests and haven't gotten any false positives. Thanks, Signed-off-by: Josef Bacik <jbacik@fb.com> Reviewed-by: David Sterba <dsterba@suse.com> [ update error messages, add fixup from Dan Carpenter to handle errors of read_tree_block ] Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 2fcc3c30d471..e2afe524e25e 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -1097,6 +1097,11 @@ struct btrfs_fs_info {
u32 nodesize;
u32 sectorsize;
u32 stripesize;
+
+#ifdef CONFIG_BTRFS_FS_REF_VERIFY
+ spinlock_t ref_verify_lock;
+ struct rb_root block_tree;
+#endif
};
static inline struct btrfs_fs_info *btrfs_sb(struct super_block *sb)