Skip to content

Commit

Permalink
nvme-tcp: block BH in sk state_change sk callback
Browse files Browse the repository at this point in the history
The TCP stack can run from process context for a long time
so we should disable BH here.

Fixes: 3f2304f ("nvme-tcp: add NVMe over TCP host driver")
Signed-off-by: Sagi Grimberg <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
  • Loading branch information
sagigrimberg authored and Christoph Hellwig committed Apr 2, 2021
1 parent 79695dc commit 8b73b45
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/nvme/host/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,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;
Expand All @@ -891,7 +891,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)
Expand Down

0 comments on commit 8b73b45

Please sign in to comment.