Skip to content

Commit 3820c4f

Browse files
maurizio-lombardikeithbusch
authored andcommitted
nvme-rdma: do not try to stop unallocated queues
Trying to stop a queue which hasn't been allocated will result in a warning due to calling mutex_lock() against an uninitialized mutex. DEBUG_LOCKS_WARN_ON(lock->magic != lock) WARNING: CPU: 4 PID: 104150 at kernel/locking/mutex.c:579 Call trace: RIP: 0010:__mutex_lock+0x1173/0x14a0 nvme_rdma_stop_queue+0x1b/0xa0 [nvme_rdma] nvme_rdma_teardown_io_queues.part.0+0xb0/0x1d0 [nvme_rdma] nvme_rdma_delete_ctrl+0x50/0x100 [nvme_rdma] nvme_do_delete_ctrl+0x149/0x158 [nvme_core] Signed-off-by: Maurizio Lombardi <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Tested-by: Yi Zhang <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent 07a1141 commit 3820c4f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/nvme/host/rdma.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,9 @@ static void __nvme_rdma_stop_queue(struct nvme_rdma_queue *queue)
638638

639639
static void nvme_rdma_stop_queue(struct nvme_rdma_queue *queue)
640640
{
641+
if (!test_bit(NVME_RDMA_Q_ALLOCATED, &queue->flags))
642+
return;
643+
641644
mutex_lock(&queue->queue_lock);
642645
if (test_and_clear_bit(NVME_RDMA_Q_LIVE, &queue->flags))
643646
__nvme_rdma_stop_queue(queue);

0 commit comments

Comments
 (0)