diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-04-13 22:41:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-04-13 22:41:27 -0400 |
commit | 659e45d8a0aca8619f0d308448c480279fa002b6 (patch) | |
tree | 4475e6a64568e81d9418265eb4932f017e7a61a9 /fs/btrfs/scrub.c | |
parent | c104f1fa1ecf4ee0fc06e31b1f77630b2551be81 (diff) | |
parent | d53ba47484ed6245e640ee4bfe9d21e9bfc15765 (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/scrub.c')
-rw-r--r-- | fs/btrfs/scrub.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 90acc82046c3..bc015f77f3ea 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c | |||
@@ -1044,6 +1044,8 @@ static int scrub_recheck_block(struct btrfs_fs_info *fs_info, | |||
1044 | 1044 | ||
1045 | BUG_ON(!page->page); | 1045 | BUG_ON(!page->page); |
1046 | bio = bio_alloc(GFP_NOFS, 1); | 1046 | bio = bio_alloc(GFP_NOFS, 1); |
1047 | if (!bio) | ||
1048 | return -EIO; | ||
1047 | bio->bi_bdev = page->bdev; | 1049 | bio->bi_bdev = page->bdev; |
1048 | bio->bi_sector = page->physical >> 9; | 1050 | bio->bi_sector = page->physical >> 9; |
1049 | bio->bi_end_io = scrub_complete_bio_end_io; | 1051 | bio->bi_end_io = scrub_complete_bio_end_io; |
@@ -1171,6 +1173,8 @@ static int scrub_repair_page_from_good_copy(struct scrub_block *sblock_bad, | |||
1171 | DECLARE_COMPLETION_ONSTACK(complete); | 1173 | DECLARE_COMPLETION_ONSTACK(complete); |
1172 | 1174 | ||
1173 | bio = bio_alloc(GFP_NOFS, 1); | 1175 | bio = bio_alloc(GFP_NOFS, 1); |
1176 | if (!bio) | ||
1177 | return -EIO; | ||
1174 | bio->bi_bdev = page_bad->bdev; | 1178 | bio->bi_bdev = page_bad->bdev; |
1175 | bio->bi_sector = page_bad->physical >> 9; | 1179 | bio->bi_sector = page_bad->physical >> 9; |
1176 | bio->bi_end_io = scrub_complete_bio_end_io; | 1180 | bio->bi_end_io = scrub_complete_bio_end_io; |