[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241102063953.228107-1-honggangli@163.com>
Date: Sat, 2 Nov 2024 14:39:53 +0800
From: Honggang LI <honggangli@....com>
To: hch@....de,
sagi@...mberg.me,
kch@...dia.com
Cc: linux-nvme@...ts.infradead.org,
linux-kernel@...r.kernel.org,
Honggang LI <honggangli@....com>
Subject: [PATCH] nvmet-rdma: WARN_ON when nvmet_rdma_rsp::n_rdma equal zero
nvmet_rdma_rsp::n_rdma is an u8, which can't be negative.
Signed-off-by: Honggang LI <honggangli@....com>
---
drivers/nvme/target/rdma.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
index 1afd93026f9b..cdeb275a388b 100644
--- a/drivers/nvme/target/rdma.c
+++ b/drivers/nvme/target/rdma.c
@@ -750,7 +750,7 @@ static void nvmet_rdma_read_data_done(struct ib_cq *cq, struct ib_wc *wc)
struct nvmet_rdma_queue *queue = wc->qp->qp_context;
u16 status = 0;
- WARN_ON(rsp->n_rdma <= 0);
+ WARN_ON(rsp->n_rdma == 0);
atomic_add(rsp->n_rdma, &queue->sq_wr_avail);
rsp->n_rdma = 0;
@@ -787,7 +787,7 @@ static void nvmet_rdma_write_data_done(struct ib_cq *cq, struct ib_wc *wc)
if (!IS_ENABLED(CONFIG_BLK_DEV_INTEGRITY))
return;
- WARN_ON(rsp->n_rdma <= 0);
+ WARN_ON(rsp->n_rdma == 0);
atomic_add(rsp->n_rdma, &queue->sq_wr_avail);
rsp->n_rdma = 0;
--
2.47.0
Powered by blists - more mailing lists