diff options
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index f9efb68fc2e3..a0c37b2ee9ed 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -353,6 +353,10 @@ static int csum_dirty_buffer(struct btrfs_root *root, struct page *page) | |||
353 | WARN_ON(len == 0); | 353 | WARN_ON(len == 0); |
354 | 354 | ||
355 | eb = alloc_extent_buffer(tree, start, len, page, GFP_NOFS); | 355 | eb = alloc_extent_buffer(tree, start, len, page, GFP_NOFS); |
356 | if (eb == NULL) { | ||
357 | WARN_ON(1); | ||
358 | goto out; | ||
359 | } | ||
356 | ret = btree_read_extent_buffer_pages(root, eb, start + PAGE_CACHE_SIZE, | 360 | ret = btree_read_extent_buffer_pages(root, eb, start + PAGE_CACHE_SIZE, |
357 | btrfs_header_generation(eb)); | 361 | btrfs_header_generation(eb)); |
358 | BUG_ON(ret); | 362 | BUG_ON(ret); |
@@ -427,6 +431,10 @@ static int btree_readpage_end_io_hook(struct page *page, u64 start, u64 end, | |||
427 | WARN_ON(len == 0); | 431 | WARN_ON(len == 0); |
428 | 432 | ||
429 | eb = alloc_extent_buffer(tree, start, len, page, GFP_NOFS); | 433 | eb = alloc_extent_buffer(tree, start, len, page, GFP_NOFS); |
434 | if (eb == NULL) { | ||
435 | ret = -EIO; | ||
436 | goto out; | ||
437 | } | ||
430 | 438 | ||
431 | found_start = btrfs_header_bytenr(eb); | 439 | found_start = btrfs_header_bytenr(eb); |
432 | if (found_start != start) { | 440 | if (found_start != start) { |