From: Zhao Lei Date: Thu, 25 Mar 2010 12:34:49 +0000 (+0000) Subject: Btrfs: Add error handle for btrfs_search_slot() in btrfs_read_chunk_tree() X-Git-Tag: MMI-PSA29.97-13-9~23937^2~14 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ab59381ea43f81c977cbd09add26950aaf6cb9fe;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git Btrfs: Add error handle for btrfs_search_slot() in btrfs_read_chunk_tree() 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 Signed-off-by: Miao Xie Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 9df8e3f1ccab..c6c80093eac0 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -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];