A user had a problem where btrfsck would bail out because it was finding
extents for a snapshot that had been deleted but not entirely cleaned up.
We can handle this case fine, we just need to report an error properly.
This patch allowed btrfsck to continue and eventually fix his file system.
Thanks,
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
fs_root_objectid(key.objectid)) {
tmp_root = btrfs_read_fs_root_no_cache(root->fs_info,
&key);
+ if (IS_ERR(tmp_root)) {
+ err = 1;
+ goto next;
+ }
ret = check_fs_root(tmp_root, root_cache, &wc);
if (ret)
err = 1;
process_root_ref(leaf, path.slots[0], &key,
root_cache);
}
+next:
path.slots[0]++;
}
btrfs_release_path(tree_root, &path);
key.offset = (u64)-1;
ref_root = btrfs_read_fs_root(root->fs_info, &key);
- BUG_ON(IS_ERR(ref_root));
+ if (IS_ERR(ref_root))
+ return 1;
level = btrfs_header_level(buf);
if (level == 0)