diff options
author | Tsutomu Itoh <t-itoh@jp.fujitsu.com> | 2011-03-24 02:33:21 -0400 |
---|---|---|
committer | root <Chris Mason chris.mason@oracle.com> | 2011-03-28 05:37:37 -0400 |
commit | 97d9a8a420444eb5b5c071d4b3b9c4100a7ae015 (patch) | |
tree | 4ed3e77541ebcc4885c4a10630e2f6bf94d3cef2 /fs/btrfs/ctree.c | |
parent | 7e75bf3ff3a716d7b21d8fb43bf823115801c1e9 (diff) |
Btrfs: check return value of read_tree_block()
This patch is checking return value of read_tree_block(),
and if it is NULL, error processing.
Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.c')
-rw-r--r-- | fs/btrfs/ctree.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 4edcbe915736..84d7ca1fe0ba 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c | |||
@@ -682,6 +682,8 @@ int btrfs_realloc_node(struct btrfs_trans_handle *trans, | |||
682 | if (!cur) { | 682 | if (!cur) { |
683 | cur = read_tree_block(root, blocknr, | 683 | cur = read_tree_block(root, blocknr, |
684 | blocksize, gen); | 684 | blocksize, gen); |
685 | if (!cur) | ||
686 | return -EIO; | ||
685 | } else if (!uptodate) { | 687 | } else if (!uptodate) { |
686 | btrfs_read_buffer(cur, gen); | 688 | btrfs_read_buffer(cur, gen); |
687 | } | 689 | } |
@@ -4087,6 +4089,7 @@ find_next_key: | |||
4087 | } | 4089 | } |
4088 | btrfs_set_path_blocking(path); | 4090 | btrfs_set_path_blocking(path); |
4089 | cur = read_node_slot(root, cur, slot); | 4091 | cur = read_node_slot(root, cur, slot); |
4092 | BUG_ON(!cur); | ||
4090 | 4093 | ||
4091 | btrfs_tree_lock(cur); | 4094 | btrfs_tree_lock(cur); |
4092 | 4095 | ||