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-6.9-20240412' of git://git.kernel.dk/linux

Pull block fixes from Jens Axboe:

- MD pull request via Song:
- UAF fix (Yu)

- Avoid out-of-bounds shift in blk-iocost (Rik)

- Fix for q->blkg_list corruption (Ming)

- Relax virt boundary mask/size segment checking (Ming)

* tag 'block-6.9-20240412' of git://git.kernel.dk/linux:
block: fix that blk_time_get_ns() doesn't update time after schedule
block: allow device to have both virt_boundary_mask and max segment size
block: fix q->blkg_list corruption during disk rebind
blk-iocost: avoid out of bounds shift
raid1: fix use-after-free for original bio in raid1_write_request()

+22 -17
+6 -3
block/blk-cgroup.c
··· 1409 1409 return 0; 1410 1410 } 1411 1411 1412 + void blkg_init_queue(struct request_queue *q) 1413 + { 1414 + INIT_LIST_HEAD(&q->blkg_list); 1415 + mutex_init(&q->blkcg_mutex); 1416 + } 1417 + 1412 1418 int blkcg_init_disk(struct gendisk *disk) 1413 1419 { 1414 1420 struct request_queue *q = disk->queue; 1415 1421 struct blkcg_gq *new_blkg, *blkg; 1416 1422 bool preloaded; 1417 1423 int ret; 1418 - 1419 - INIT_LIST_HEAD(&q->blkg_list); 1420 - mutex_init(&q->blkcg_mutex); 1421 1424 1422 1425 new_blkg = blkg_alloc(&blkcg_root, disk, GFP_KERNEL); 1423 1426 if (!new_blkg)
+2
block/blk-cgroup.h
··· 189 189 extern struct blkcg blkcg_root; 190 190 extern bool blkcg_debug_stats; 191 191 192 + void blkg_init_queue(struct request_queue *q); 192 193 int blkcg_init_disk(struct gendisk *disk); 193 194 void blkcg_exit_disk(struct gendisk *disk); 194 195 ··· 483 482 }; 484 483 485 484 static inline struct blkcg_gq *blkg_lookup(struct blkcg *blkcg, void *key) { return NULL; } 485 + static inline void blkg_init_queue(struct request_queue *q) { } 486 486 static inline int blkcg_init_disk(struct gendisk *disk) { return 0; } 487 487 static inline void blkcg_exit_disk(struct gendisk *disk) { } 488 488 static inline int blkcg_policy_register(struct blkcg_policy *pol) { return 0; }
+3
block/blk-core.c
··· 442 442 init_waitqueue_head(&q->mq_freeze_wq); 443 443 mutex_init(&q->mq_freeze_lock); 444 444 445 + blkg_init_queue(q); 446 + 445 447 /* 446 448 * Init percpu_ref in atomic mode so that it's faster to shutdown. 447 449 * See blk_register_queue() for details. ··· 1197 1195 if (unlikely(!rq_list_empty(plug->cached_rq))) 1198 1196 blk_mq_free_plug_rqs(plug); 1199 1197 1198 + plug->cur_ktime = 0; 1200 1199 current->flags &= ~PF_BLOCK_TS; 1201 1200 } 1202 1201
+4 -3
block/blk-iocost.c
··· 1347 1347 { 1348 1348 struct ioc *ioc = iocg->ioc; 1349 1349 struct blkcg_gq *blkg = iocg_to_blkg(iocg); 1350 - u64 tdelta, delay, new_delay; 1350 + u64 tdelta, delay, new_delay, shift; 1351 1351 s64 vover, vover_pct; 1352 1352 u32 hwa; 1353 1353 ··· 1362 1362 1363 1363 /* calculate the current delay in effect - 1/2 every second */ 1364 1364 tdelta = now->now - iocg->delay_at; 1365 - if (iocg->delay) 1366 - delay = iocg->delay >> div64_u64(tdelta, USEC_PER_SEC); 1365 + shift = div64_u64(tdelta, USEC_PER_SEC); 1366 + if (iocg->delay && shift < BITS_PER_LONG) 1367 + delay = iocg->delay >> shift; 1367 1368 else 1368 1369 delay = 0; 1369 1370
+6 -10
block/blk-settings.c
··· 182 182 return -EINVAL; 183 183 184 184 /* 185 - * Devices that require a virtual boundary do not support scatter/gather 186 - * I/O natively, but instead require a descriptor list entry for each 187 - * page (which might not be identical to the Linux PAGE_SIZE). Because 188 - * of that they are not limited by our notion of "segment size". 185 + * Stacking device may have both virtual boundary and max segment 186 + * size limit, so allow this setting now, and long-term the two 187 + * might need to move out of stacking limits since we have immutable 188 + * bvec and lower layer bio splitting is supposed to handle the two 189 + * correctly. 189 190 */ 190 - if (lim->virt_boundary_mask) { 191 - if (WARN_ON_ONCE(lim->max_segment_size && 192 - lim->max_segment_size != UINT_MAX)) 193 - return -EINVAL; 194 - lim->max_segment_size = UINT_MAX; 195 - } else { 191 + if (!lim->virt_boundary_mask) { 196 192 /* 197 193 * The maximum segment size has an odd historic 64k default that 198 194 * drivers probably should override. Just like the I/O size we
+1 -1
drivers/md/raid1.c
··· 1558 1558 for (j = 0; j < i; j++) 1559 1559 if (r1_bio->bios[j]) 1560 1560 rdev_dec_pending(conf->mirrors[j].rdev, mddev); 1561 - free_r1bio(r1_bio); 1561 + mempool_free(r1_bio, &conf->r1bio_pool); 1562 1562 allow_barrier(conf, bio->bi_iter.bi_sector); 1563 1563 1564 1564 if (bio->bi_opf & REQ_NOWAIT) {