Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

nvmet-tcp: use 'spin_lock_bh' for state_lock()

nvmet_tcp_schedule_release_queue() is called from socket state
change callbacks, which may be called from an softirq context.
So use 'spin_lock_bh' to avoid a spin lock warning.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>

authored by

Hannes Reinecke and committed by
Keith Busch
bbacf792 d6800634

+2 -2
+2 -2
drivers/nvme/target/tcp.c
··· 1379 1379 1380 1380 static void nvmet_tcp_schedule_release_queue(struct nvmet_tcp_queue *queue) 1381 1381 { 1382 - spin_lock(&queue->state_lock); 1382 + spin_lock_bh(&queue->state_lock); 1383 1383 if (queue->state == NVMET_TCP_Q_TLS_HANDSHAKE) { 1384 1384 /* Socket closed during handshake */ 1385 1385 tls_handshake_cancel(queue->sock->sk); ··· 1388 1388 queue->state = NVMET_TCP_Q_DISCONNECTING; 1389 1389 kref_put(&queue->kref, nvmet_tcp_release_queue); 1390 1390 } 1391 - spin_unlock(&queue->state_lock); 1391 + spin_unlock_bh(&queue->state_lock); 1392 1392 } 1393 1393 1394 1394 static inline void nvmet_tcp_arm_queue_deadline(struct nvmet_tcp_queue *queue)