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 tag 'block-5.12-2021-03-27' of git://git.kernel.dk/linux-block

Pull block fixes from Jens Axboe:

- Fix regression from this merge window with the xarray partition
change, which allowed partition counts that overflow the u8 that
holds the partition number (Ming)

- Fix zone append warning (Johannes)

- Segmentation count fix for multipage bvecs (David)

- Partition scan fix (Chris)

* tag 'block-5.12-2021-03-27' of git://git.kernel.dk/linux-block:
block: don't create too many partitions
block: support zone append bvecs
block: recalculate segment count for multi-segment discards correctly
block: clear GD_NEED_PART_SCAN later in bdev_disk_changed

+35 -5
+18 -3
block/bio.c
··· 949 949 } 950 950 EXPORT_SYMBOL_GPL(bio_release_pages); 951 951 952 - static int bio_iov_bvec_set(struct bio *bio, struct iov_iter *iter) 952 + static void __bio_iov_bvec_set(struct bio *bio, struct iov_iter *iter) 953 953 { 954 954 WARN_ON_ONCE(bio->bi_max_vecs); 955 955 ··· 959 959 bio->bi_iter.bi_size = iter->count; 960 960 bio_set_flag(bio, BIO_NO_PAGE_REF); 961 961 bio_set_flag(bio, BIO_CLONED); 962 + } 962 963 964 + static int bio_iov_bvec_set(struct bio *bio, struct iov_iter *iter) 965 + { 966 + __bio_iov_bvec_set(bio, iter); 963 967 iov_iter_advance(iter, iter->count); 968 + return 0; 969 + } 970 + 971 + static int bio_iov_bvec_set_append(struct bio *bio, struct iov_iter *iter) 972 + { 973 + struct request_queue *q = bio->bi_bdev->bd_disk->queue; 974 + struct iov_iter i = *iter; 975 + 976 + iov_iter_truncate(&i, queue_max_zone_append_sectors(q) << 9); 977 + __bio_iov_bvec_set(bio, &i); 978 + iov_iter_advance(iter, i.count); 964 979 return 0; 965 980 } 966 981 ··· 1109 1094 int ret = 0; 1110 1095 1111 1096 if (iov_iter_is_bvec(iter)) { 1112 - if (WARN_ON_ONCE(bio_op(bio) == REQ_OP_ZONE_APPEND)) 1113 - return -EINVAL; 1097 + if (bio_op(bio) == REQ_OP_ZONE_APPEND) 1098 + return bio_iov_bvec_set_append(bio, iter); 1114 1099 return bio_iov_bvec_set(bio, iter); 1115 1100 } 1116 1101
+8
block/blk-merge.c
··· 382 382 switch (bio_op(rq->bio)) { 383 383 case REQ_OP_DISCARD: 384 384 case REQ_OP_SECURE_ERASE: 385 + if (queue_max_discard_segments(rq->q) > 1) { 386 + struct bio *bio = rq->bio; 387 + 388 + for_each_bio(bio) 389 + nr_phys_segs++; 390 + return nr_phys_segs; 391 + } 392 + return 1; 385 393 case REQ_OP_WRITE_ZEROES: 386 394 return 0; 387 395 case REQ_OP_WRITE_SAME:
+7
block/partitions/core.c
··· 323 323 int err; 324 324 325 325 /* 326 + * disk_max_parts() won't be zero, either GENHD_FL_EXT_DEVT is set 327 + * or 'minors' is passed to alloc_disk(). 328 + */ 329 + if (partno >= disk_max_parts(disk)) 330 + return ERR_PTR(-EINVAL); 331 + 332 + /* 326 333 * Partitions are not supported on zoned block devices that are used as 327 334 * such. 328 335 */
+2 -2
fs/block_dev.c
··· 1240 1240 1241 1241 lockdep_assert_held(&bdev->bd_mutex); 1242 1242 1243 - clear_bit(GD_NEED_PART_SCAN, &bdev->bd_disk->state); 1244 - 1245 1243 rescan: 1246 1244 ret = blk_drop_partitions(bdev); 1247 1245 if (ret) 1248 1246 return ret; 1247 + 1248 + clear_bit(GD_NEED_PART_SCAN, &disk->state); 1249 1249 1250 1250 /* 1251 1251 * Historically we only set the capacity to zero for devices that