Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309904
b: refs/heads/master
c: 86ff7ff
h: refs/heads/master
v: v3
  • Loading branch information
Stefan Behrens authored and Josef Bacik committed May 30, 2012
1 parent cd32b97 commit 76ada77
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3d136a1131c66f7d26fb171e4c5b0b8baacd3129
refs/heads/master: 86ff7ffce0b93aed14df4c8dcedd05bb5e2fdfbc
25 changes: 22 additions & 3 deletions trunk/fs/btrfs/check-integrity.c
Original file line number Diff line number Diff line change
Expand Up @@ -1428,6 +1428,28 @@ static int btrfsic_handle_extent_data(

file_extent_item_offset = offsetof(struct btrfs_leaf, items) +
item_offset;
if (file_extent_item_offset +
offsetof(struct btrfs_file_extent_item, disk_num_bytes) >
block_ctx->len) {
printk(KERN_INFO
"btrfsic: file item out of bounce at logical %llu, dev %s\n",
block_ctx->start, block_ctx->dev->name);
return -1;
}

btrfsic_read_from_block_data(block_ctx, &file_extent_item,
file_extent_item_offset,
offsetof(struct btrfs_file_extent_item, disk_num_bytes));
if (BTRFS_FILE_EXTENT_REG != file_extent_item.type ||
((u64)0) == le64_to_cpu(file_extent_item.disk_bytenr)) {
if (state->print_mask & BTRFSIC_PRINT_MASK_VERY_VERBOSE)
printk(KERN_INFO "extent_data: type %u, disk_bytenr = %llu\n",
file_extent_item.type,
(unsigned long long)
le64_to_cpu(file_extent_item.disk_bytenr));
return 0;
}

if (file_extent_item_offset + sizeof(struct btrfs_file_extent_item) >
block_ctx->len) {
printk(KERN_INFO
Expand All @@ -1452,9 +1474,6 @@ static int btrfsic_handle_extent_data(
le64_to_cpu(file_extent_item.disk_bytenr),
(unsigned long long)le64_to_cpu(file_extent_item.offset),
(unsigned long long)num_bytes);
if (BTRFS_FILE_EXTENT_REG != file_extent_item.type ||
((u64)0) == le64_to_cpu(file_extent_item.disk_bytenr))
return 0;
while (num_bytes > 0) {
u32 chunk_len;
int num_copies;
Expand Down

0 comments on commit 76ada77

Please sign in to comment.