Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 243166
b: refs/heads/master
c: 97d9a8a
h: refs/heads/master
v: v3
  • Loading branch information
Tsutomu Itoh authored and root committed Mar 28, 2011
1 parent 734f277 commit a52e347
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7e75bf3ff3a716d7b21d8fb43bf823115801c1e9
refs/heads/master: 97d9a8a420444eb5b5c071d4b3b9c4100a7ae015
3 changes: 3 additions & 0 deletions trunk/fs/btrfs/ctree.c
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,8 @@ int btrfs_realloc_node(struct btrfs_trans_handle *trans,
if (!cur) {
cur = read_tree_block(root, blocknr,
blocksize, gen);
if (!cur)
return -EIO;
} else if (!uptodate) {
btrfs_read_buffer(cur, gen);
}
Expand Down Expand Up @@ -4087,6 +4089,7 @@ int btrfs_search_forward(struct btrfs_root *root, struct btrfs_key *min_key,
}
btrfs_set_path_blocking(path);
cur = read_node_slot(root, cur, slot);
BUG_ON(!cur);

btrfs_tree_lock(cur);

Expand Down
6 changes: 6 additions & 0 deletions trunk/fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -6067,6 +6067,8 @@ static noinline int do_walk_down(struct btrfs_trans_handle *trans,
if (reada && level == 1)
reada_walk_down(trans, root, wc, path);
next = read_tree_block(root, bytenr, blocksize, generation);
if (!next)
return -EIO;
btrfs_tree_lock(next);
btrfs_set_lock_blocking(next);
}
Expand Down Expand Up @@ -7937,6 +7939,10 @@ static noinline int relocate_one_extent(struct btrfs_root *extent_root,

eb = read_tree_block(found_root, block_start,
block_size, 0);
if (!eb) {
ret = -EIO;
goto out;
}
btrfs_tree_lock(eb);
BUG_ON(level != btrfs_header_level(eb));

Expand Down
6 changes: 6 additions & 0 deletions trunk/fs/btrfs/relocation.c
Original file line number Diff line number Diff line change
Expand Up @@ -1724,6 +1724,7 @@ int replace_path(struct btrfs_trans_handle *trans,

eb = read_tree_block(dest, old_bytenr, blocksize,
old_ptr_gen);
BUG_ON(!eb);
btrfs_tree_lock(eb);
if (cow) {
ret = btrfs_cow_block(trans, dest, eb, parent,
Expand Down Expand Up @@ -2513,6 +2514,10 @@ static int do_relocation(struct btrfs_trans_handle *trans,
blocksize = btrfs_level_size(root, node->level);
generation = btrfs_node_ptr_generation(upper->eb, slot);
eb = read_tree_block(root, bytenr, blocksize, generation);
if (!eb) {
err = -EIO;
goto next;
}
btrfs_tree_lock(eb);
btrfs_set_lock_blocking(eb);

Expand Down Expand Up @@ -2670,6 +2675,7 @@ static int get_tree_block_key(struct reloc_control *rc,
BUG_ON(block->key_ready);
eb = read_tree_block(rc->extent_root, block->bytenr,
block->key.objectid, block->key.offset);
BUG_ON(!eb);
WARN_ON(btrfs_header_level(eb) != block->level);
if (block->level == 0)
btrfs_item_key_to_cpu(eb, &block->key, 0);
Expand Down

0 comments on commit a52e347

Please sign in to comment.