diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-04-02 10:50:19 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2007-04-02 10:50:19 -0400 |
commit | 2c90e5d658424bc71b111eb5a972240d5d06fe86 (patch) | |
tree | f46b830654af0f67ef1691353fe4d79943a05465 /fs/btrfs/extent-tree.c | |
parent | d6025579531b7ea170ba283b171ff7a6bf7d0e12 (diff) |
Btrfs: still corruption hunting
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r-- | fs/btrfs/extent-tree.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index c4194dab7a33..37b87e28a2f3 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -173,12 +173,16 @@ static int pin_down_block(struct btrfs_root *root, u64 blocknr, int pending) | |||
173 | 173 | ||
174 | if (!pending) { | 174 | if (!pending) { |
175 | bh = btrfs_find_tree_block(root, blocknr); | 175 | bh = btrfs_find_tree_block(root, blocknr); |
176 | if (bh && buffer_uptodate(bh)) { | 176 | if (bh) { |
177 | header = btrfs_buffer_header(bh); | 177 | if (buffer_uptodate(bh)) { |
178 | if (btrfs_header_generation(header) == | 178 | u64 transid = |
179 | root->fs_info->running_transaction->transid) { | 179 | root->fs_info->running_transaction->transid; |
180 | btrfs_block_release(root, bh); | 180 | header = btrfs_buffer_header(bh); |
181 | return 0; | 181 | if (btrfs_header_generation(header) == |
182 | transid) { | ||
183 | btrfs_block_release(root, bh); | ||
184 | return 0; | ||
185 | } | ||
182 | } | 186 | } |
183 | btrfs_block_release(root, bh); | 187 | btrfs_block_release(root, bh); |
184 | } | 188 | } |
@@ -539,6 +543,8 @@ static int walk_down_tree(struct btrfs_trans_handle *trans, struct btrfs_root | |||
539 | */ | 543 | */ |
540 | while(*level >= 0) { | 544 | while(*level >= 0) { |
541 | cur = path->nodes[*level]; | 545 | cur = path->nodes[*level]; |
546 | if (btrfs_header_level(btrfs_buffer_header(cur)) != *level) | ||
547 | WARN_ON(1); | ||
542 | if (path->slots[*level] >= | 548 | if (path->slots[*level] >= |
543 | btrfs_header_nritems(btrfs_buffer_header(cur))) | 549 | btrfs_header_nritems(btrfs_buffer_header(cur))) |
544 | break; | 550 | break; |