diff options
author | Chris Mason <chris.mason@oracle.com> | 2011-08-01 14:27:34 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-08-01 14:27:34 -0400 |
commit | b43b31bdf2e662006c27cc4dcccf863312d62bc1 (patch) | |
tree | 9e12413edbd9d7a77e4c0b692dd28ca4ae5039bd /fs/btrfs/file-item.c | |
parent | ff95acb6733d41a8d45feb0e18b96df25e610e78 (diff) | |
parent | 38a1a919535742af677303271eb4ff731547b706 (diff) | |
download | linux-3.10-b43b31bdf2e662006c27cc4dcccf863312d62bc1.tar.gz linux-3.10-b43b31bdf2e662006c27cc4dcccf863312d62bc1.tar.bz2 linux-3.10-b43b31bdf2e662006c27cc4dcccf863312d62bc1.zip |
Merge branch 'alloc_path' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/btrfs-error-handling into for-linus
Diffstat (limited to 'fs/btrfs/file-item.c')
-rw-r--r-- | fs/btrfs/file-item.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c index 08bcfa92a22..b910694f61e 100644 --- a/fs/btrfs/file-item.c +++ b/fs/btrfs/file-item.c @@ -291,7 +291,8 @@ int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start, u64 end, u16 csum_size = btrfs_super_csum_size(&root->fs_info->super_copy); path = btrfs_alloc_path(); - BUG_ON(!path); + if (!path) + return -ENOMEM; if (search_commit) { path->skip_locking = 1; @@ -677,7 +678,9 @@ int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans, btrfs_super_csum_size(&root->fs_info->super_copy); path = btrfs_alloc_path(); - BUG_ON(!path); + if (!path) + return -ENOMEM; + sector_sum = sums->sums; again: next_offset = (u64)-1; |