Skip to content

Commit abe7a48

Browse files
committed
Merge tag 'block-6.0-2022-08-12' of git://git.kernel.dk/linux-block
Pull block fixes from Jens Axboe: - NVMe pull request - print nvme connect Linux error codes properly (Amit Engel) - fix the fc_appid_store return value (Christoph Hellwig) - fix a typo in an error message (Christophe JAILLET) - add another non-unique identifier quirk (Dennis P. Kliem) - check if the queue is allocated before stopping it in nvme-tcp (Maurizio Lombardi) - restart admin queue if the caller needs to restart queue in nvme-fc (Ming Lei) - use kmemdup instead of kmalloc + memcpy in nvme-auth (Zhang Xiaoxu) - __alloc_disk_node() error handling fix (Rafael) * tag 'block-6.0-2022-08-12' of git://git.kernel.dk/linux-block: block: Do not call blk_put_queue() if gendisk allocation fails nvme-pci: add NVME_QUIRK_BOGUS_NID for ADATA XPG GAMMIX S70 nvme-tcp: check if the queue is allocated before stopping it nvme-fabrics: Fix a typo in an error message nvme-fabrics: parse nvme connect Linux error codes nvmet-auth: use kmemdup instead of kmalloc + memcpy nvme-fc: fix the fc_appid_store return value nvme-fc: restart admin queue if the caller needs to restart queue
2 parents 1da8cf9 + aa0c680 commit abe7a48

File tree

6 files changed

+19
-7
lines changed

6 files changed

+19
-7
lines changed

block/genhd.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,7 @@ struct gendisk *__alloc_disk_node(struct request_queue *q, int node_id,
13411341

13421342
disk = kzalloc_node(sizeof(struct gendisk), GFP_KERNEL, node_id);
13431343
if (!disk)
1344-
goto out_put_queue;
1344+
return NULL;
13451345

13461346
if (bioset_init(&disk->bio_split, BIO_POOL_SIZE, 0, 0))
13471347
goto out_free_disk;
@@ -1390,8 +1390,6 @@ struct gendisk *__alloc_disk_node(struct request_queue *q, int node_id,
13901390
bioset_exit(&disk->bio_split);
13911391
out_free_disk:
13921392
kfree(disk);
1393-
out_put_queue:
1394-
blk_put_queue(q);
13951393
return NULL;
13961394
}
13971395

drivers/nvme/host/fabrics.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,12 @@ static void nvmf_log_connect_error(struct nvme_ctrl *ctrl,
270270
{
271271
int err_sctype = errval & ~NVME_SC_DNR;
272272

273+
if (errval < 0) {
274+
dev_err(ctrl->device,
275+
"Connect command failed, errno: %d\n", errval);
276+
return;
277+
}
278+
273279
switch (err_sctype) {
274280
case NVME_SC_CONNECT_INVALID_PARAM:
275281
if (offset >> 16) {
@@ -1230,7 +1236,7 @@ static int __init nvmf_init(void)
12301236
nvmf_device =
12311237
device_create(nvmf_class, NULL, MKDEV(0, 0), NULL, "ctl");
12321238
if (IS_ERR(nvmf_device)) {
1233-
pr_err("couldn't create nvme-fabris device!\n");
1239+
pr_err("couldn't create nvme-fabrics device!\n");
12341240
ret = PTR_ERR(nvmf_device);
12351241
goto out_destroy_class;
12361242
}

drivers/nvme/host/fc.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2533,6 +2533,8 @@ __nvme_fc_abort_outstanding_ios(struct nvme_fc_ctrl *ctrl, bool start_queues)
25332533
blk_mq_tagset_busy_iter(&ctrl->admin_tag_set,
25342534
nvme_fc_terminate_exchange, &ctrl->ctrl);
25352535
blk_mq_tagset_wait_completed_request(&ctrl->admin_tag_set);
2536+
if (start_queues)
2537+
nvme_start_admin_queue(&ctrl->ctrl);
25362538
}
25372539

25382540
static void
@@ -3878,6 +3880,7 @@ static int fc_parse_cgrpid(const char *buf, u64 *id)
38783880
static ssize_t fc_appid_store(struct device *dev,
38793881
struct device_attribute *attr, const char *buf, size_t count)
38803882
{
3883+
size_t orig_count = count;
38813884
u64 cgrp_id;
38823885
int appid_len = 0;
38833886
int cgrpid_len = 0;
@@ -3902,7 +3905,7 @@ static ssize_t fc_appid_store(struct device *dev,
39023905
ret = blkcg_set_fc_appid(app_id, cgrp_id, sizeof(app_id));
39033906
if (ret < 0)
39043907
return ret;
3905-
return count;
3908+
return orig_count;
39063909
}
39073910
static DEVICE_ATTR(appid_store, 0200, NULL, fc_appid_store);
39083911
#endif /* CONFIG_BLK_CGROUP_FC_APPID */

drivers/nvme/host/pci.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3511,6 +3511,8 @@ static const struct pci_device_id nvme_id_table[] = {
35113511
.driver_data = NVME_QUIRK_BOGUS_NID, },
35123512
{ PCI_DEVICE(0x1cc1, 0x5350), /* ADATA XPG GAMMIX S50 */
35133513
.driver_data = NVME_QUIRK_BOGUS_NID, },
3514+
{ PCI_DEVICE(0x1dbe, 0x5236), /* ADATA XPG GAMMIX S70 */
3515+
.driver_data = NVME_QUIRK_BOGUS_NID, },
35143516
{ PCI_DEVICE(0x1e49, 0x0041), /* ZHITAI TiPro7000 NVMe SSD */
35153517
.driver_data = NVME_QUIRK_NO_DEEPEST_PS, },
35163518
{ PCI_DEVICE(0xc0a9, 0x540a), /* Crucial P2 */

drivers/nvme/host/tcp.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,6 +1660,9 @@ static void nvme_tcp_stop_queue(struct nvme_ctrl *nctrl, int qid)
16601660
struct nvme_tcp_ctrl *ctrl = to_tcp_ctrl(nctrl);
16611661
struct nvme_tcp_queue *queue = &ctrl->queues[qid];
16621662

1663+
if (!test_bit(NVME_TCP_Q_ALLOCATED, &queue->flags))
1664+
return;
1665+
16631666
mutex_lock(&queue->queue_lock);
16641667
if (test_and_clear_bit(NVME_TCP_Q_LIVE, &queue->flags))
16651668
__nvme_tcp_stop_queue(queue);

drivers/nvme/target/fabrics-cmd-auth.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,10 @@ static u16 nvmet_auth_reply(struct nvmet_req *req, void *d)
160160
pr_debug("%s: ctrl %d qid %d host authenticated\n",
161161
__func__, ctrl->cntlid, req->sq->qid);
162162
if (data->cvalid) {
163-
req->sq->dhchap_c2 = kmalloc(data->hl, GFP_KERNEL);
163+
req->sq->dhchap_c2 = kmemdup(data->rval + data->hl, data->hl,
164+
GFP_KERNEL);
164165
if (!req->sq->dhchap_c2)
165166
return NVME_AUTH_DHCHAP_FAILURE_FAILED;
166-
memcpy(req->sq->dhchap_c2, data->rval + data->hl, data->hl);
167167

168168
pr_debug("%s: ctrl %d qid %d challenge %*ph\n",
169169
__func__, ctrl->cntlid, req->sq->qid, data->hl,

0 commit comments

Comments
 (0)