diff options
author | Zhao Lei <zhaolei@cn.fujitsu.com> | 2010-03-25 08:34:49 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2010-03-30 21:19:09 -0400 |
commit | ab59381ea43f81c977cbd09add26950aaf6cb9fe (patch) | |
tree | 5c009854f6c04996492b3bcadc538ed9264948b9 /fs/btrfs/volumes.c | |
parent | 471fa17dff556ad38caf26de097c0630530d8cbe (diff) |
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/btrfs/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 2 |
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) | |||
3389 | key.type = 0; | 3389 | key.type = 0; |
3390 | again: | 3390 | again: |
3391 | ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); | 3391 | ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); |
3392 | if (ret < 0) | ||
3393 | goto error; | ||
3392 | while (1) { | 3394 | while (1) { |
3393 | leaf = path->nodes[0]; | 3395 | leaf = path->nodes[0]; |
3394 | slot = path->slots[0]; | 3396 | slot = path->slots[0]; |