Skip to content

Commit

Permalink
nvme-tcp: fix wrong stop condition in io_work
Browse files Browse the repository at this point in the history
Allow the do/while statement to continue if current time
is not after the proposed time 'deadline'. Intent is to
allow loop to proceed for a specific time period. Currently
the loop, as coded, will exit after first pass.

Signed-off-by: Mark Wunderlich <mark.wunderlich@intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
  • Loading branch information
Wunderlich, Mark authored and Sagi Grimberg committed Sep 25, 2019
1 parent b224726 commit ddef295
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 @@ -1042,7 +1042,7 @@ static void nvme_tcp_io_work(struct work_struct *w)
{
struct nvme_tcp_queue *queue =
container_of(w, struct nvme_tcp_queue, io_work);
unsigned long start = jiffies + msecs_to_jiffies(1);
unsigned long deadline = jiffies + msecs_to_jiffies(1);

do {
bool pending = false;
Expand All @@ -1067,7 +1067,7 @@ static void nvme_tcp_io_work(struct work_struct *w)
if (!pending)
return;

} while (time_after(jiffies, start)); /* quota is exhausted */
} while (!time_after(jiffies, deadline)); /* quota is exhausted */

queue_work_on(queue->io_cpu, nvme_tcp_wq, &queue->io_work);
}
Expand Down

0 comments on commit ddef295

Please sign in to comment.