diff options
-rw-r--r-- | fs/btrfs/file-item.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c index ee25e50e7c04..e17cce33fe95 100644 --- a/fs/btrfs/file-item.c +++ b/fs/btrfs/file-item.c | |||
@@ -161,7 +161,6 @@ int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans, | |||
161 | unsigned long map_len; | 161 | unsigned long map_len; |
162 | unsigned long map_start; | 162 | unsigned long map_start; |
163 | 163 | ||
164 | |||
165 | path = btrfs_alloc_path(); | 164 | path = btrfs_alloc_path(); |
166 | BUG_ON(!path); | 165 | BUG_ON(!path); |
167 | again: | 166 | again: |
@@ -315,8 +314,11 @@ next_bvec: | |||
315 | if (bio_index < bio->bi_vcnt) { | 314 | if (bio_index < bio->bi_vcnt) { |
316 | item = (struct btrfs_csum_item *)((char *)item + | 315 | item = (struct btrfs_csum_item *)((char *)item + |
317 | BTRFS_CRC32_SIZE); | 316 | BTRFS_CRC32_SIZE); |
318 | if (item < item_end) | 317 | if (item < item_end && offset + PAGE_CACHE_SIZE == |
318 | page_offset(bvec->bv_page)) { | ||
319 | offset = page_offset(bvec->bv_page); | ||
319 | goto next_bvec; | 320 | goto next_bvec; |
321 | } | ||
320 | } | 322 | } |
321 | if (eb_token) { | 323 | if (eb_token) { |
322 | unmap_extent_buffer(leaf, eb_token, KM_IRQ1); | 324 | unmap_extent_buffer(leaf, eb_token, KM_IRQ1); |