]> www.infradead.org Git - users/dwmw2/linux.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 07:44:24 +0000 (09:44 +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 ac3503ea54c46ce0f688a6396aa05967455b29f2..718152adc625432ee92453de664edad3850fe6ed 100644 (file)
@@ -816,7 +816,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;
@@ -838,7 +838,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 void nvme_tcp_done_send_req(struct nvme_tcp_queue *queue)