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.0-2022-09-16' of git://git.kernel.dk/linux-block

Pull block fixes from Jens Axboe:
"Two fixes for -rc6:

- Fix a mixup of sectors and bytes in the secure erase ioctl
(Mikulas)

- Fix for a bad return value for a non-blocking bio/blk queue enter
call (me)"

* tag 'block-6.0-2022-09-16' of git://git.kernel.dk/linux-block:
blk-lib: fix blkdev_issue_secure_erase
block: blk_queue_enter() / __bio_queue_enter() must return -EAGAIN for nowait

+10 -5
+2 -2
block/blk-core.c
··· 295 296 while (!blk_try_enter_queue(q, pm)) { 297 if (flags & BLK_MQ_REQ_NOWAIT) 298 - return -EBUSY; 299 300 /* 301 * read pair of barrier in blk_freeze_queue_start(), we need to ··· 325 if (test_bit(GD_DEAD, &disk->state)) 326 goto dead; 327 bio_wouldblock_error(bio); 328 - return -EBUSY; 329 } 330 331 /*
··· 295 296 while (!blk_try_enter_queue(q, pm)) { 297 if (flags & BLK_MQ_REQ_NOWAIT) 298 + return -EAGAIN; 299 300 /* 301 * read pair of barrier in blk_freeze_queue_start(), we need to ··· 325 if (test_bit(GD_DEAD, &disk->state)) 326 goto dead; 327 bio_wouldblock_error(bio); 328 + return -EAGAIN; 329 } 330 331 /*
+8 -3
block/blk-lib.c
··· 309 struct blk_plug plug; 310 int ret = 0; 311 312 if (max_sectors == 0) 313 return -EOPNOTSUPP; 314 if ((sector | nr_sects) & bs_mask) ··· 327 328 bio = blk_next_bio(bio, bdev, 0, REQ_OP_SECURE_ERASE, gfp); 329 bio->bi_iter.bi_sector = sector; 330 - bio->bi_iter.bi_size = len; 331 332 - sector += len << SECTOR_SHIFT; 333 - nr_sects -= len << SECTOR_SHIFT; 334 if (!nr_sects) { 335 ret = submit_bio_wait(bio); 336 bio_put(bio);
··· 309 struct blk_plug plug; 310 int ret = 0; 311 312 + /* make sure that "len << SECTOR_SHIFT" doesn't overflow */ 313 + if (max_sectors > UINT_MAX >> SECTOR_SHIFT) 314 + max_sectors = UINT_MAX >> SECTOR_SHIFT; 315 + max_sectors &= ~bs_mask; 316 + 317 if (max_sectors == 0) 318 return -EOPNOTSUPP; 319 if ((sector | nr_sects) & bs_mask) ··· 322 323 bio = blk_next_bio(bio, bdev, 0, REQ_OP_SECURE_ERASE, gfp); 324 bio->bi_iter.bi_sector = sector; 325 + bio->bi_iter.bi_size = len << SECTOR_SHIFT; 326 327 + sector += len; 328 + nr_sects -= len; 329 if (!nr_sects) { 330 ret = submit_bio_wait(bio); 331 bio_put(bio);