Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus-4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs

Pull btrfs fixes from Chris Mason:
"Dave Sterba collected a few more fixes for the last rc.

These aren't marked for stable, but I'm putting them in with a batch
were testing/sending by hand for this release"

* 'for-linus-4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
Btrfs: fix potential use-after-free for cloned bio
Btrfs: fix segmentation fault when doing dio read
Btrfs: fix invalid dereference in btrfs_retry_endio
btrfs: drop the nossd flag when remounting with -o ssd

+14 -13
+10 -12
fs/btrfs/inode.c
··· 7910 7910 static void btrfs_retry_endio_nocsum(struct bio *bio) 7911 7911 { 7912 7912 struct btrfs_retry_complete *done = bio->bi_private; 7913 - struct inode *inode; 7914 7913 struct bio_vec *bvec; 7915 7914 int i; 7916 7915 ··· 7917 7918 goto end; 7918 7919 7919 7920 ASSERT(bio->bi_vcnt == 1); 7920 - inode = bio->bi_io_vec->bv_page->mapping->host; 7921 - ASSERT(bio->bi_io_vec->bv_len == btrfs_inode_sectorsize(inode)); 7921 + ASSERT(bio->bi_io_vec->bv_len == btrfs_inode_sectorsize(done->inode)); 7922 7922 7923 7923 done->uptodate = 1; 7924 7924 bio_for_each_segment_all(bvec, bio, i) 7925 - clean_io_failure(BTRFS_I(done->inode), done->start, bvec->bv_page, 0); 7925 + clean_io_failure(BTRFS_I(done->inode), done->start, 7926 + bvec->bv_page, 0); 7926 7927 end: 7927 7928 complete(&done->done); 7928 7929 bio_put(bio); ··· 7972 7973 7973 7974 start += sectorsize; 7974 7975 7975 - if (nr_sectors--) { 7976 + nr_sectors--; 7977 + if (nr_sectors) { 7976 7978 pgoff += sectorsize; 7979 + ASSERT(pgoff < PAGE_SIZE); 7977 7980 goto next_block_or_try_again; 7978 7981 } 7979 7982 } ··· 7987 7986 { 7988 7987 struct btrfs_retry_complete *done = bio->bi_private; 7989 7988 struct btrfs_io_bio *io_bio = btrfs_io_bio(bio); 7990 - struct inode *inode; 7991 7989 struct bio_vec *bvec; 7992 - u64 start; 7993 7990 int uptodate; 7994 7991 int ret; 7995 7992 int i; ··· 7997 7998 7998 7999 uptodate = 1; 7999 8000 8000 - start = done->start; 8001 - 8002 8001 ASSERT(bio->bi_vcnt == 1); 8003 - inode = bio->bi_io_vec->bv_page->mapping->host; 8004 - ASSERT(bio->bi_io_vec->bv_len == btrfs_inode_sectorsize(inode)); 8002 + ASSERT(bio->bi_io_vec->bv_len == btrfs_inode_sectorsize(done->inode)); 8005 8003 8006 8004 bio_for_each_segment_all(bvec, bio, i) { 8007 8005 ret = __readpage_endio_check(done->inode, io_bio, i, ··· 8076 8080 8077 8081 ASSERT(nr_sectors); 8078 8082 8079 - if (--nr_sectors) { 8083 + nr_sectors--; 8084 + if (nr_sectors) { 8080 8085 pgoff += sectorsize; 8086 + ASSERT(pgoff < PAGE_SIZE); 8081 8087 goto next_block; 8082 8088 } 8083 8089 }
+3
fs/btrfs/super.c
··· 549 549 case Opt_ssd: 550 550 btrfs_set_and_info(info, SSD, 551 551 "use ssd allocation scheme"); 552 + btrfs_clear_opt(info->mount_opt, NOSSD); 552 553 break; 553 554 case Opt_ssd_spread: 554 555 btrfs_set_and_info(info, SSD_SPREAD, 555 556 "use spread ssd allocation scheme"); 556 557 btrfs_set_opt(info->mount_opt, SSD); 558 + btrfs_clear_opt(info->mount_opt, NOSSD); 557 559 break; 558 560 case Opt_nossd: 559 561 btrfs_set_and_info(info, NOSSD, 560 562 "not using ssd allocation scheme"); 561 563 btrfs_clear_opt(info->mount_opt, SSD); 564 + btrfs_clear_opt(info->mount_opt, SSD_SPREAD); 562 565 break; 563 566 case Opt_barrier: 564 567 btrfs_clear_and_info(info, NOBARRIER,
+1 -1
fs/btrfs/volumes.c
··· 6213 6213 for (dev_nr = 0; dev_nr < total_devs; dev_nr++) { 6214 6214 dev = bbio->stripes[dev_nr].dev; 6215 6215 if (!dev || !dev->bdev || 6216 - (bio_op(bio) == REQ_OP_WRITE && !dev->writeable)) { 6216 + (bio_op(first_bio) == REQ_OP_WRITE && !dev->writeable)) { 6217 6217 bbio_error(bbio, first_bio, logical); 6218 6218 continue; 6219 6219 }