Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 332609
b: refs/heads/master
c: 15e3004
h: refs/heads/master
i:
  332607: 9f25ab2
v: v3
  • Loading branch information
Josef Bacik authored and Chris Mason committed Oct 9, 2012
1 parent f66f28f commit 0bd2c83
Show file tree
Hide file tree
Showing 2 changed files with 11 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: 5af3e8cce8b7ba0a2819e18c9146c8c0b452d479
refs/heads/master: 15e3004a0eb2c4879bc666d0e6a3acd973fb226c
13 changes: 10 additions & 3 deletions trunk/fs/btrfs/compression.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,7 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
u64 em_start;
struct extent_map *em;
int ret = -ENOMEM;
int faili = 0;
u32 *sums;

tree = &BTRFS_I(inode)->io_tree;
Expand Down Expand Up @@ -626,9 +627,13 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
for (pg_index = 0; pg_index < nr_pages; pg_index++) {
cb->compressed_pages[pg_index] = alloc_page(GFP_NOFS |
__GFP_HIGHMEM);
if (!cb->compressed_pages[pg_index])
if (!cb->compressed_pages[pg_index]) {
faili = pg_index - 1;
ret = -ENOMEM;
goto fail2;
}
}
faili = nr_pages - 1;
cb->nr_pages = nr_pages;

add_ra_bio_pages(inode, em_start + em_len, cb);
Expand Down Expand Up @@ -713,8 +718,10 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
return 0;

fail2:
for (pg_index = 0; pg_index < nr_pages; pg_index++)
free_page((unsigned long)cb->compressed_pages[pg_index]);
while (faili >= 0) {
__free_page(cb->compressed_pages[faili]);
faili--;
}

kfree(cb->compressed_pages);
fail1:
Expand Down

0 comments on commit 0bd2c83

Please sign in to comment.