summaryrefslogtreecommitdiff
path: root/fs/btrfs/file-item.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-04-24 08:11:20 +0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-04-24 08:11:20 +0400
commit973e2abd15326114ff9a099d6dfe0ef6be6fc7e6 (patch)
tree06ef7573e06500a4999a755006eb9a95bdf85ffa /fs/btrfs/file-item.c
parent5676005acf26ab7e924a8438ea4746e47d405762 (diff)
parent016af59f0f8cd10f27773df8f0034b5f3b46a138 (diff)
downloadlinux-973e2abd15326114ff9a099d6dfe0ef6be6fc7e6.tar.xz
Merge remote-tracking branch 'mpe/master' into next
Merge the tentative powerpc-next branch maintained by Michael while I was on vacation
Diffstat (limited to 'fs/btrfs/file-item.c')
-rw-r--r--fs/btrfs/file-item.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c
index ec160202be3e..c4628a201cb3 100644
--- a/fs/btrfs/file-item.c
+++ b/fs/btrfs/file-item.c
@@ -118,9 +118,11 @@ struct btrfs_csum_item *btrfs_lookup_csum(struct btrfs_trans_handle *trans,
csums_in_item = btrfs_item_size_nr(leaf, path->slots[0]);
csums_in_item /= csum_size;
- if (csum_offset >= csums_in_item) {
+ if (csum_offset == csums_in_item) {
ret = -EFBIG;
goto fail;
+ } else if (csum_offset > csums_in_item) {
+ goto fail;
}
}
item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_csum_item);
@@ -728,7 +730,6 @@ int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans,
return -ENOMEM;
sector_sum = sums->sums;
- trans->adding_csums = 1;
again:
next_offset = (u64)-1;
found_next = 0;
@@ -899,7 +900,6 @@ next_sector:
goto again;
}
out:
- trans->adding_csums = 0;
btrfs_free_path(path);
return ret;