Skip to content

Commit

Permalink
Btrfs: Add error handle for btrfs_search_slot() in btrfs_read_chunk_t…
Browse files Browse the repository at this point in the history
…ree()

We need to check return value of btrfs_search_slot() in
btrfs_read_chunk_tree() and do corresponding error handing.

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Zhao Lei authored and Chris Mason committed Mar 31, 2010
1 parent 471fa17 commit ab59381
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -3389,6 +3389,8 @@ int btrfs_read_chunk_tree(struct btrfs_root *root)
key.type = 0;
again:
ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
if (ret < 0)
goto error;
while (1) {
leaf = path->nodes[0];
slot = path->slots[0];
Expand Down

0 comments on commit ab59381

Please sign in to comment.