aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_io.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-04-13 22:41:27 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-04-13 22:41:27 -0400
commit659e45d8a0aca8619f0d308448c480279fa002b6 (patch)
tree4475e6a64568e81d9418265eb4932f017e7a61a9 /fs/btrfs/extent_io.c
parentc104f1fa1ecf4ee0fc06e31b1f77630b2551be81 (diff)
parentd53ba47484ed6245e640ee4bfe9d21e9bfc15765 (diff)
Merge branch 'for-linus-min' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs
Pull the minimal btrfs branch from Chris Mason: "We have a use-after-free in there, along with errors when mount -o discard is enabled, and a BUG_ON(we should compile with UP more often)." * 'for-linus-min' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: Btrfs: use commit root when loading free space cache Btrfs: fix use-after-free in __btrfs_end_transaction Btrfs: check return value of bio_alloc() properly Btrfs: remove lock assert from get_restripe_target() Btrfs: fix eof while discarding extents Btrfs: fix uninit variable in repair_eb_io_failure Revert "Btrfs: increase the global block reserve estimates"
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r--fs/btrfs/extent_io.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 8d904dd7ea9f..cd4b5e400221 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -1937,7 +1937,7 @@ int repair_eb_io_failure(struct btrfs_root *root, struct extent_buffer *eb,
1937 struct btrfs_mapping_tree *map_tree = &root->fs_info->mapping_tree; 1937 struct btrfs_mapping_tree *map_tree = &root->fs_info->mapping_tree;
1938 u64 start = eb->start; 1938 u64 start = eb->start;
1939 unsigned long i, num_pages = num_extent_pages(eb->start, eb->len); 1939 unsigned long i, num_pages = num_extent_pages(eb->start, eb->len);
1940 int ret; 1940 int ret = 0;
1941 1941
1942 for (i = 0; i < num_pages; i++) { 1942 for (i = 0; i < num_pages; i++) {
1943 struct page *p = extent_buffer_page(eb, i); 1943 struct page *p = extent_buffer_page(eb, i);
@@ -2180,6 +2180,10 @@ static int bio_readpage_error(struct bio *failed_bio, struct page *page,
2180 } 2180 }
2181 2181
2182 bio = bio_alloc(GFP_NOFS, 1); 2182 bio = bio_alloc(GFP_NOFS, 1);
2183 if (!bio) {
2184 free_io_failure(inode, failrec, 0);
2185 return -EIO;
2186 }
2183 bio->bi_private = state; 2187 bio->bi_private = state;
2184 bio->bi_end_io = failed_bio->bi_end_io; 2188 bio->bi_end_io = failed_bio->bi_end_io;
2185 bio->bi_sector = failrec->logical >> 9; 2189 bio->bi_sector = failrec->logical >> 9;