diff options
author | Wang Shilong <wangsl.fnst@cn.fujitsu.com> | 2013-11-28 13:32:49 +0800 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-01-31 08:22:07 -0800 |
commit | 52ddfa74fe191dd8ec23702be2aac3f76f86e4d3 (patch) | |
tree | 9e3b0873ed3ce0abe5b6143daf3d2ce215960dcb /volumes.c | |
parent | 387d5f32347e426214389e0251a1240e076d250d (diff) |
Btrfs-progs: chunk-recover: add new flag to prepare recovering for ordered data chunk
When reading block groups we will searching it's corresponding chunk, however, at this
time, some chunks has not been built(data chunks raid0/raid10/raid56), don't bug_on here,
we will try to rebuild these chunks later.
Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'volumes.c')
-rw-r--r-- | volumes.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -1496,8 +1496,15 @@ int btrfs_chunk_readonly(struct btrfs_root *root, u64 chunk_offset) int readonly = 0; int i; + /* + * During chunk recovering, we may fail to find block group's + * corresponding chunk, we will rebuild it later + */ ce = search_cache_extent(&map_tree->cache_tree, chunk_offset); - BUG_ON(!ce); + if (!root->fs_info->is_chunk_recover) + BUG_ON(!ce); + else + return 0; map = container_of(ce, struct map_lookup, ce); for (i = 0; i < map->num_stripes; i++) { |