Skip to content

Commit

Permalink
nvme-tcp: Fix warning with CONFIG_DEBUG_PREEMPT
Browse files Browse the repository at this point in the history
We shouldn't call smp_processor_id() in a preemptible
context, but this is advisory at best, so instead
call __smp_processor_id().

Fixes: db5ad6b ("nvme-tcp: try to send request in queue_rq context")
Reported-by: Or Gerlitz <[email protected]>
Reported-by: Yi Zhang <[email protected]>
Signed-off-by: Sagi Grimberg <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
  • Loading branch information
sagigrimberg authored and Christoph Hellwig committed Jan 14, 2021
1 parent 7a84665 commit ada8317
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/nvme/host/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ static inline void nvme_tcp_queue_request(struct nvme_tcp_request *req,
* directly, otherwise queue io_work. Also, only do that if we
* are on the same cpu, so we don't introduce contention.
*/
if (queue->io_cpu == smp_processor_id() &&
if (queue->io_cpu == __smp_processor_id() &&
sync && empty && mutex_trylock(&queue->send_mutex)) {
queue->more_requests = !last;
nvme_tcp_send_all(queue);
Expand Down

0 comments on commit ada8317

Please sign in to comment.