Skip to content

Commit cc9f062

Browse files
committed
Merge tag 'block-6.15-20250509' of git://git.kernel.dk/linux
Pull block fixes from Jens Axboe: - Fix for a regression in this series for loop and read/write iterator handling - zone append block update tweak - remove a broken IO priority test - NVMe pull request via Christoph: - unblock ctrl state transition for firmware update (Daniel Wagner) * tag 'block-6.15-20250509' of git://git.kernel.dk/linux: block: remove test of incorrect io priority level nvme: unblock ctrl state transition for firmware update block: only update request sector if needed loop: Add sanity check for read/write_iter
2 parents 7380c60 + dd90905 commit cc9f062

File tree

4 files changed

+28
-7
lines changed

4 files changed

+28
-7
lines changed

block/blk.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,8 @@ static inline void blk_zone_update_request_bio(struct request *rq,
480480
* the original BIO sector so that blk_zone_write_plug_bio_endio() can
481481
* lookup the zone write plug.
482482
*/
483-
if (req_op(rq) == REQ_OP_ZONE_APPEND || bio_zone_write_plugging(bio))
483+
if (req_op(rq) == REQ_OP_ZONE_APPEND ||
484+
bio_flagged(bio, BIO_EMULATES_ZONE_APPEND))
484485
bio->bi_iter.bi_sector = rq->__sector;
485486
}
486487
void blk_zone_write_plug_bio_endio(struct bio *bio);

block/ioprio.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,8 @@ int ioprio_check_cap(int ioprio)
4646
*/
4747
if (!capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_NICE))
4848
return -EPERM;
49-
fallthrough;
50-
/* rt has prio field too */
51-
case IOPRIO_CLASS_BE:
52-
if (level >= IOPRIO_NR_LEVELS)
53-
return -EINVAL;
5449
break;
50+
case IOPRIO_CLASS_BE:
5551
case IOPRIO_CLASS_IDLE:
5652
break;
5753
case IOPRIO_CLASS_NONE:

drivers/block/loop.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,17 @@ static void loop_assign_backing_file(struct loop_device *lo, struct file *file)
505505
lo->lo_min_dio_size = loop_query_min_dio_size(lo);
506506
}
507507

508+
static int loop_check_backing_file(struct file *file)
509+
{
510+
if (!file->f_op->read_iter)
511+
return -EINVAL;
512+
513+
if ((file->f_mode & FMODE_WRITE) && !file->f_op->write_iter)
514+
return -EINVAL;
515+
516+
return 0;
517+
}
518+
508519
/*
509520
* loop_change_fd switched the backing store of a loopback device to
510521
* a new file. This is useful for operating system installers to free up
@@ -526,6 +537,10 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
526537
if (!file)
527538
return -EBADF;
528539

540+
error = loop_check_backing_file(file);
541+
if (error)
542+
return error;
543+
529544
/* suppress uevents while reconfiguring the device */
530545
dev_set_uevent_suppress(disk_to_dev(lo->lo_disk), 1);
531546

@@ -963,6 +978,14 @@ static int loop_configure(struct loop_device *lo, blk_mode_t mode,
963978

964979
if (!file)
965980
return -EBADF;
981+
982+
if ((mode & BLK_OPEN_WRITE) && !file->f_op->write_iter)
983+
return -EINVAL;
984+
985+
error = loop_check_backing_file(file);
986+
if (error)
987+
return error;
988+
966989
is_loop = is_loop_device(file);
967990

968991
/* This is safe, since we have a reference from open(). */

drivers/nvme/host/core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4493,7 +4493,8 @@ static void nvme_fw_act_work(struct work_struct *work)
44934493
msleep(100);
44944494
}
44954495

4496-
if (!nvme_change_ctrl_state(ctrl, NVME_CTRL_LIVE))
4496+
if (!nvme_change_ctrl_state(ctrl, NVME_CTRL_CONNECTING) ||
4497+
!nvme_change_ctrl_state(ctrl, NVME_CTRL_LIVE))
44974498
return;
44984499

44994500
nvme_unquiesce_io_queues(ctrl);

0 commit comments

Comments
 (0)