Btrfs: Add error handle for btrfs_search_slot() in btrfs_read_chunk_tree()
authorZhao Lei <zhaolei@cn.fujitsu.com>
Thu, 25 Mar 2010 12:34:49 +0000 (12:34 +0000)
committerChris Mason <chris.mason@oracle.com>
Wed, 31 Mar 2010 01:19:09 +0000 (21:19 -0400)
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>
fs/btrfs/volumes.c

index 9df8e3f1ccabea1daa2e3d4fd93fdb6424fa4555..c6c80093eac00d6ae57a84a220c97f42f0a85c23 100644 (file)
@@ -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];