Skip to content

Commit 1cc1570

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.dk/linux-block
Pull block fixes from Jens Axboe: "A few fixes that should go into this series: - Regression fix for ide-cd, ensuring that a request is fully initialized. From Hongxu. - Ditto fix for virtio_blk, from Bart. - NVMe fix from Keith, ensuring that we set the right block size on revalidation. If the block size changed, we'd be in trouble without it. - NVMe rdma fix from Sagi, fixing a potential hang while the controller is being removed" * 'for-linus' of git://git.kernel.dk/linux-block: ide:ide-cd: fix kernel panic resulting from missing scsi_req_init nvme: Fix setting logical block format when revalidating virtio_blk: Fix an SG_IO regression nvme-rdma: fix possible hang when issuing commands during ctrl removal
2 parents 4f2ba5d + 79d7334 commit 1cc1570

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

drivers/block/virtio_blk.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,10 +593,22 @@ static int virtblk_map_queues(struct blk_mq_tag_set *set)
593593
return blk_mq_virtio_map_queues(set, vblk->vdev, 0);
594594
}
595595

596+
#ifdef CONFIG_VIRTIO_BLK_SCSI
597+
static void virtblk_initialize_rq(struct request *req)
598+
{
599+
struct virtblk_req *vbr = blk_mq_rq_to_pdu(req);
600+
601+
scsi_req_init(&vbr->sreq);
602+
}
603+
#endif
604+
596605
static const struct blk_mq_ops virtio_mq_ops = {
597606
.queue_rq = virtio_queue_rq,
598607
.complete = virtblk_request_done,
599608
.init_request = virtblk_init_request,
609+
#ifdef CONFIG_VIRTIO_BLK_SCSI
610+
.initialize_rq_fn = virtblk_initialize_rq,
611+
#endif
600612
.map_queues = virtblk_map_queues,
601613
};
602614

drivers/ide/ide-cd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,6 +1328,7 @@ static int ide_cdrom_prep_fs(struct request_queue *q, struct request *rq)
13281328
unsigned long blocks = blk_rq_sectors(rq) / (hard_sect >> 9);
13291329
struct scsi_request *req = scsi_req(rq);
13301330

1331+
scsi_req_init(req);
13311332
memset(req->cmd, 0, BLK_MAX_CDB);
13321333

13331334
if (rq_data_dir(rq) == READ)

drivers/nvme/host/core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,6 +1249,7 @@ static int nvme_revalidate_disk(struct gendisk *disk)
12491249
goto out;
12501250
}
12511251

1252+
__nvme_revalidate_disk(disk, id);
12521253
nvme_report_ns_ids(ctrl, ns->ns_id, id, eui64, nguid, &uuid);
12531254
if (!uuid_equal(&ns->uuid, &uuid) ||
12541255
memcmp(&ns->nguid, &nguid, sizeof(ns->nguid)) ||

drivers/nvme/host/rdma.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,12 +1614,15 @@ nvme_rdma_queue_is_ready(struct nvme_rdma_queue *queue, struct request *rq)
16141614
/*
16151615
* reconnecting state means transport disruption, which
16161616
* can take a long time and even might fail permanently,
1617-
* so we can't let incoming I/O be requeued forever.
1618-
* fail it fast to allow upper layers a chance to
1619-
* failover.
1617+
* fail fast to give upper layers a chance to failover.
1618+
* deleting state means that the ctrl will never accept
1619+
* commands again, fail it permanently.
16201620
*/
1621-
if (queue->ctrl->ctrl.state == NVME_CTRL_RECONNECTING)
1621+
if (queue->ctrl->ctrl.state == NVME_CTRL_RECONNECTING ||
1622+
queue->ctrl->ctrl.state == NVME_CTRL_DELETING) {
1623+
nvme_req(rq)->status = NVME_SC_ABORT_REQ;
16221624
return BLK_STS_IOERR;
1625+
}
16231626
return BLK_STS_RESOURCE; /* try again later */
16241627
}
16251628
}

0 commit comments

Comments
 (0)