]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
nvme-tcp: block BH in sk state_change sk callback
authorSagi Grimberg <sagi@grimberg.me>
Sun, 21 Mar 2021 07:08:48 +0000 (00:08 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 08:49:54 +0000 (10:49 +0200)
[ Upstream commit 8b73b45d54a14588f86792869bfb23098ea254cb ]

The TCP stack can run from process context for a long time
so we should disable BH here.

Fixes: 3f2304f8c6d6 ("nvme-tcp: add NVMe over TCP host driver")
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/tcp.c

index c6958e5bc91d531f02f4f214b040c8695f0ad3af..709a573183a2024c1351cd74cb8f1b599c24d5d3 100644 (file)
@@ -874,7 +874,7 @@ static void nvme_tcp_state_change(struct sock *sk)
 {
        struct nvme_tcp_queue *queue;
 
-       read_lock(&sk->sk_callback_lock);
+       read_lock_bh(&sk->sk_callback_lock);
        queue = sk->sk_user_data;
        if (!queue)
                goto done;
@@ -895,7 +895,7 @@ static void nvme_tcp_state_change(struct sock *sk)
 
        queue->state_change(sk);
 done:
-       read_unlock(&sk->sk_callback_lock);
+       read_unlock_bh(&sk->sk_callback_lock);
 }
 
 static inline bool nvme_tcp_queue_more(struct nvme_tcp_queue *queue)