Commit ddef2957 authored by Wunderlich, Mark's avatar Wunderlich, Mark Committed by Sagi Grimberg

nvme-tcp: fix wrong stop condition in io_work

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: default avatarMark Wunderlich <mark.wunderlich@intel.com>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Signed-off-by: default avatarSagi Grimberg <sagi@grimberg.me>
parent b224726d
......@@ -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;
......@@ -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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment