svn commit: r292543 - head/sys/compat/linuxkpi/common/include/linux
Hans Petter Selasky
hselasky at FreeBSD.org
Mon Dec 21 12:13:04 UTC 2015
Author: hselasky
Date: Mon Dec 21 12:13:03 2015
New Revision: 292543
URL: https://svnweb.freebsd.org/changeset/base/292543
Log:
In the zero delay case in queue_delayed_work() use the return value
from taskqueue_enqueue() instead of reading "ta_pending" unlocked and
also ensure the callout is stopped before proceeding.
MFC after: 1 week
Sponsored by: Mellanox Technologies
Modified:
head/sys/compat/linuxkpi/common/include/linux/workqueue.h
Modified: head/sys/compat/linuxkpi/common/include/linux/workqueue.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/workqueue.h Mon Dec 21 11:58:59 2015 (r292542)
+++ head/sys/compat/linuxkpi/common/include/linux/workqueue.h Mon Dec 21 12:13:03 2015 (r292543)
@@ -105,13 +105,15 @@ queue_delayed_work(struct workqueue_stru
{
int pending;
- pending = work->work.work_task.ta_pending;
work->work.taskqueue = wq->taskqueue;
- if (delay != 0)
+ if (delay != 0) {
+ pending = work->work.work_task.ta_pending;
callout_reset(&work->timer, delay, linux_delayed_work_fn, work);
- else
- linux_delayed_work_fn((void *)work);
-
+ } else {
+ callout_stop(&work->timer);
+ pending = taskqueue_enqueue(work->work.taskqueue,
+ &work->work.work_task);
+ }
return (!pending);
}
More information about the svn-src-head
mailing list