Skip to content

Commit dea3132

Browse files
committed
Merge tag 'nvme-6.1-2022-10-27' of git://git.infradead.org/nvme into block-6.1
Pull NVMe fixes from Christoph: "nvme fixes for Linux 6.1 - make the multipath dma alignment to match the non-multipath one (Keith Busch) - fix a bogus use of sg_init_marker() (Nam Cao) - fix circulr locking in nvme-tcp (Sagi Grimberg)" * tag 'nvme-6.1-2022-10-27' of git://git.infradead.org/nvme: nvme-multipath: set queue dma alignment to 3 nvme-tcp: fix possible circular locking when deleting a controller under memory pressure nvme-tcp: replace sg_init_marker() with sg_init_table()
2 parents 2d87d45 + fe8714b commit dea3132

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

drivers/nvme/host/multipath.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ int nvme_mpath_alloc_disk(struct nvme_ctrl *ctrl, struct nvme_ns_head *head)
516516
/* set to a default value of 512 until the disk is validated */
517517
blk_queue_logical_block_size(head->disk->queue, 512);
518518
blk_set_stacking_limits(&head->disk->queue->limits);
519+
blk_queue_dma_alignment(head->disk->queue, 3);
519520

520521
/* we need to propagate up the VMC settings */
521522
if (ctrl->vwc & NVME_CTRL_VWC_PRESENT)

drivers/nvme/host/tcp.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ static inline void nvme_tcp_ddgst_update(struct ahash_request *hash,
387387
{
388388
struct scatterlist sg;
389389

390-
sg_init_marker(&sg, 1);
390+
sg_init_table(&sg, 1);
391391
sg_set_page(&sg, page, len, off);
392392
ahash_request_set_crypt(hash, &sg, NULL, len);
393393
crypto_ahash_update(hash);
@@ -1141,6 +1141,7 @@ static int nvme_tcp_try_send_ddgst(struct nvme_tcp_request *req)
11411141
static int nvme_tcp_try_send(struct nvme_tcp_queue *queue)
11421142
{
11431143
struct nvme_tcp_request *req;
1144+
unsigned int noreclaim_flag;
11441145
int ret = 1;
11451146

11461147
if (!queue->request) {
@@ -1150,12 +1151,13 @@ static int nvme_tcp_try_send(struct nvme_tcp_queue *queue)
11501151
}
11511152
req = queue->request;
11521153

1154+
noreclaim_flag = memalloc_noreclaim_save();
11531155
if (req->state == NVME_TCP_SEND_CMD_PDU) {
11541156
ret = nvme_tcp_try_send_cmd_pdu(req);
11551157
if (ret <= 0)
11561158
goto done;
11571159
if (!nvme_tcp_has_inline_data(req))
1158-
return ret;
1160+
goto out;
11591161
}
11601162

11611163
if (req->state == NVME_TCP_SEND_H2C_PDU) {
@@ -1181,6 +1183,8 @@ static int nvme_tcp_try_send(struct nvme_tcp_queue *queue)
11811183
nvme_tcp_fail_request(queue->request);
11821184
nvme_tcp_done_send_req(queue);
11831185
}
1186+
out:
1187+
memalloc_noreclaim_restore(noreclaim_flag);
11841188
return ret;
11851189
}
11861190

@@ -1296,6 +1300,7 @@ static void nvme_tcp_free_queue(struct nvme_ctrl *nctrl, int qid)
12961300
struct page *page;
12971301
struct nvme_tcp_ctrl *ctrl = to_tcp_ctrl(nctrl);
12981302
struct nvme_tcp_queue *queue = &ctrl->queues[qid];
1303+
unsigned int noreclaim_flag;
12991304

13001305
if (!test_and_clear_bit(NVME_TCP_Q_ALLOCATED, &queue->flags))
13011306
return;
@@ -1308,7 +1313,11 @@ static void nvme_tcp_free_queue(struct nvme_ctrl *nctrl, int qid)
13081313
__page_frag_cache_drain(page, queue->pf_cache.pagecnt_bias);
13091314
queue->pf_cache.va = NULL;
13101315
}
1316+
1317+
noreclaim_flag = memalloc_noreclaim_save();
13111318
sock_release(queue->sock);
1319+
memalloc_noreclaim_restore(noreclaim_flag);
1320+
13121321
kfree(queue->pdu);
13131322
mutex_destroy(&queue->send_mutex);
13141323
mutex_destroy(&queue->queue_lock);

0 commit comments

Comments
 (0)