summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorZhao Lei <zhaolei@cn.fujitsu.com>2010-03-25 13:34:49 +0100
committerChris Mason <chris.mason@oracle.com>2010-03-31 03:19:09 +0200
commitab59381ea43f81c977cbd09add26950aaf6cb9fe (patch)
tree5c009854f6c04996492b3bcadc538ed9264948b9 /fs
parentBtrfs: Remove unnecessary finish_wait() in wait_current_trans() (diff)
downloadlinux-ab59381ea43f81c977cbd09add26950aaf6cb9fe.tar.xz
linux-ab59381ea43f81c977cbd09add26950aaf6cb9fe.zip
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 <zhaolei@cn.fujitsu.com> Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/volumes.c2
1 files changed, 2 insertions, 0 deletions
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];