diff options
| author | Yevgeny Popovych <[email protected]> | 2018-06-05 13:11:01 +0300 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2018-06-13 07:49:12 -0400 |
| commit | f559180176a8650a78edb5be73935f51cd6a0064 (patch) | |
| tree | cde02d36f03e79eae1cab96f60c7658515726775 | |
| parent | 5b3da7fa12f3720c4e4051af21261765bf9c44e6 (diff) | |
fs: btrfs: Fix not all CHUNK_ITEMs being read from CHUNK_TREE
This causes errors when translating logical addresses to physical:
btrfs_map_logical_to_physical: Cannot map logical address <addr> to physical
btrfs_file_read: Error reading extent
The behavior of btrfs_map_logical_to_physical() is to stop traversing
CHUNK_TREE when it encounters first non-CHUNK_ITEM, which makes
only some portion of CHUNK_ITEMs being read.
Change it to skip over non-chunk items.
Signed-off-by: Yevgeny Popovych <[email protected]>
Cc: Marek Behun <[email protected]>
Cc: Sergey Struzh <[email protected]>
Reviewed-by: Marek Behun <[email protected]>
| -rw-r--r-- | fs/btrfs/chunk-map.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/chunk-map.c b/fs/btrfs/chunk-map.c index b3b5ef7652e..beb6a4bb928 100644 --- a/fs/btrfs/chunk-map.c +++ b/fs/btrfs/chunk-map.c @@ -158,7 +158,7 @@ int btrfs_read_chunk_tree(void) do { found_key = btrfs_path_leaf_key(&path); if (btrfs_comp_keys_type(&key, found_key)) - break; + continue; chunk = btrfs_path_item_ptr(&path, struct btrfs_chunk); btrfs_chunk_to_cpu(chunk); |
