Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795033072; b=brhuRcER0mM6X3qP2ycZ36waDV16yJF5uyRVEQhbuBu/1paXGnFfW3hpmRp0mlbRFF9M 9MgKKFGTV0dvYoSOefLFrrw2MZ7wXbxvExCQAsjPjVvQWqRJSpoVujaQlP49jaBSph+ND KROBWikEye6aGXCV1g9rma++LGdYtI8ZsQtQK/K974OKVbtdzMGCAwXQUU5fBDeTtwZ1a sAQGgO3nez0pUez5GmADQ77VWBZcPVVmNWbeZln0w1aDvivOUx6hWIhtSeqgnmBNsXGaq uuGGNbLU5+SJUm96BSNNIVM981r+zx3yf6SFPtbVOONKZsiZ5M89bXz8Cic9f/VwZEQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795033072; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=bWgfgnySF3ezHtBDQXzoKOp6MWYQ4xjsOovKhZQddRg=; b=KZRpS0OdRHGEO90Q55zxs0uNUQaGICUokzgHqeZRRNn7G/TRhyCcDMMieGzMUC9B6Jzf Va9B00O8IaeP78gWSwq8rgkG6u2VhR+UTMvVgbvuhPBAKkEW1B73mmr3KSOBsV+91IRpk T0JyPC/OIvJkI8cruiPBxp3tJE4EV6HESaIEeTjG+dndDdQSt2ZR2xxAs0OA9PtjUPIo+ xVf0UglrxDT3/XxG9i3seWgJyHuhislht1XBGe/svCG1U3St4qOl27MFzzUiuusfvSzrv Kgqw2DoC0J2Pqu3/wywjxT1k/PN48j4QigMfhUOFSaEGtp3OYemILwhE0M14nzaox0A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b="BvkiYDe/"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 391F1606A325; Wed, 18 Nov 2026 20:17:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=BvkiYDe/ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 955D21F000C5; Wed, 18 Nov 2026 20:17:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795033072; bh=bWgfgnySF3ezHtBDQXzoKOp6MWYQ4xjsOovKhZQddRg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=BvkiYDe/yG0ofv6EYWHoVry6Lu5vy3oiynRT59E7gOGe8L2+ktrJlK9Ac50homA0B tnsVOqOiGBs+nHABEaToybfxny14mpdB09MacHJPW0AlsOPbnb1DXieswaahU+8NDq A3AGrW4VlL+oj2sc/jCAG6w/2V4rMDyGWdPnrEPQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni , Chris Mason , Jens Axboe , Keith Busch , Sasha Levin Subject: [PATCH 6.12 1636/1756] nvmet-rdma: disable interrupts under rsp_wr_wait_lock Date: Wed, 18 Nov 2026 16:02:43 +0100 Message-ID: <20261118150114.907281463@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150007.957976754@linuxfoundation.org> References: <20261118150007.957976754@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Chris Mason [ Upstream commit 14e4e09443ac2b5cd90c1e313ee3c0bdd4928e0d ] rsp_wr_wait_lock protects the list of commands waiting for room in the send queue, and it's taken with plain spin_lock(). But nvmet_rdma_queue_response() calls nvmet_rdma_release_rsp() directly if ib_post_send() fails, and that processes the wait list. The call chain starts in nvmet_req_complete(), which for a block device namespace runs from the bio end_io callback, which can be in hard interrupt context. An interrupt that completes a command on a CPU holding the lock for the same queue spins forever. Lockdep over siw with a null_blk namespace: inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage Use spin_lock_irqsave() for both takers. The processing loop still drops the lock, and restores the caller's interrupt state, around nvmet_rdma_execute_command(). Fixes: 8f000cac6e7a ("nvmet-rdma: add a NVMe over Fabrics RDMA target driver") Cc: Christoph Hellwig Cc: Sagi Grimberg Cc: Chaitanya Kulkarni Signed-off-by: Chris Mason Signed-off-by: Jens Axboe Signed-off-by: Keith Busch Signed-off-by: Sasha Levin --- drivers/nvme/target/rdma.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c index 4c16cc9aaaa00..9a336cee93a4f 100644 --- a/drivers/nvme/target/rdma.c +++ b/drivers/nvme/target/rdma.c @@ -513,7 +513,9 @@ static int nvmet_rdma_post_recv(struct nvmet_rdma_device *ndev, static void nvmet_rdma_process_wr_wait_list(struct nvmet_rdma_queue *queue) { - spin_lock(&queue->rsp_wr_wait_lock); + unsigned long flags; + + spin_lock_irqsave(&queue->rsp_wr_wait_lock, flags); while (!list_empty(&queue->rsp_wr_wait_list)) { struct nvmet_rdma_rsp *rsp; bool ret; @@ -522,16 +524,16 @@ static void nvmet_rdma_process_wr_wait_list(struct nvmet_rdma_queue *queue) struct nvmet_rdma_rsp, wait_list); list_del(&rsp->wait_list); - spin_unlock(&queue->rsp_wr_wait_lock); + spin_unlock_irqrestore(&queue->rsp_wr_wait_lock, flags); ret = nvmet_rdma_execute_command(rsp); - spin_lock(&queue->rsp_wr_wait_lock); + spin_lock_irqsave(&queue->rsp_wr_wait_lock, flags); if (!ret) { list_add(&rsp->wait_list, &queue->rsp_wr_wait_list); break; } } - spin_unlock(&queue->rsp_wr_wait_lock); + spin_unlock_irqrestore(&queue->rsp_wr_wait_lock, flags); } static u16 nvmet_rdma_check_pi_status(struct ib_mr *sig_mr) @@ -977,6 +979,7 @@ static bool nvmet_rdma_execute_command(struct nvmet_rdma_rsp *rsp) static void nvmet_rdma_handle_command(struct nvmet_rdma_queue *queue, struct nvmet_rdma_rsp *cmd) { + unsigned long flags; u16 status; ib_dma_sync_single_for_cpu(queue->dev->device, @@ -995,9 +998,9 @@ static void nvmet_rdma_handle_command(struct nvmet_rdma_queue *queue, goto out_err; if (unlikely(!nvmet_rdma_execute_command(cmd))) { - spin_lock(&queue->rsp_wr_wait_lock); + spin_lock_irqsave(&queue->rsp_wr_wait_lock, flags); list_add_tail(&cmd->wait_list, &queue->rsp_wr_wait_list); - spin_unlock(&queue->rsp_wr_wait_lock); + spin_unlock_irqrestore(&queue->rsp_wr_wait_lock, flags); } return; -- 2.53.0