path: root/free-space-cache.c
diff options
authorEryu Guan <>2014-01-10 22:50:02 +0800
committerChris Mason <>2014-01-31 08:22:25 -0800
commitb2e99e1819d967828edf149db5a203e59a40e379 (patch)
treece30a1c71f736e438a9eaa8ec2cf133cd0850080 /free-space-cache.c
parent257a71cb24b04d5a7477b0618665ceb1e1cc149b (diff)
Btrfs-progs: check return value of read_tree_block() in check_chunks_and_extents()
The following steps could trigger btrfs segfault: mkfs -t btrfs -m raid5 -d raid5 /dev/loop{0..3} losetup -d /dev/loop2 btrfs check /dev/loop0 The reason is that read_tree_block() returns NULL and add_root_to_pending() dereferences it without checking it first. Also replace a BUG_ON with proper error checking. Signed-off-by: Eryu Guan <> Signed-off-by: David Sterba <> Signed-off-by: Chris Mason <>
Diffstat (limited to 'free-space-cache.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/free-space-cache.c b/free-space-cache.c
index 1ca7980d..55d73185 100644
--- a/free-space-cache.c
+++ b/free-space-cache.c
@@ -435,7 +435,7 @@ int load_free_space_cache(struct btrfs_fs_info *fs_info,
if (ret < 0) {
ret = 0;
- printf("failed to load free space cache for block group %llu",
+ printf("failed to load free space cache for block group %llu\n",