Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F106177789
D28017.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D28017.diff
View Options
diff --git a/sys/compat/linuxkpi/common/src/linux_work.c b/sys/compat/linuxkpi/common/src/linux_work.c
--- a/sys/compat/linuxkpi/common/src/linux_work.c
+++ b/sys/compat/linuxkpi/common/src/linux_work.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2017-2019 Hans Petter Selasky
+ * Copyright (c) 2017-2021 Hans Petter Selasky
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -433,15 +433,20 @@
};
struct taskqueue *tq;
+retry:
switch (linux_update_state(&dwork->work.state, states)) {
case WORK_ST_TIMER:
- case WORK_ST_CANCEL:
if (linux_cancel_timer(dwork, 0)) {
atomic_cmpxchg(&dwork->work.state,
WORK_ST_CANCEL, WORK_ST_IDLE);
return (true);
}
- /* FALLTHROUGH */
+ /*
+ * If the timer was not stopped, it means it has just
+ * elapsed and the state needs to be checked again:
+ */
+ goto retry;
+ case WORK_ST_CANCEL:
case WORK_ST_TASK:
tq = dwork->work.work_queue->taskqueue;
if (taskqueue_cancel(tq, &dwork->work.work_task, NULL) == 0) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 27, 4:27 PM (8 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15615777
Default Alt Text
D28017.diff (1 KB)
Attached To
Mode
D28017: Fix race in cancel_delayed_work() in the LinuxKPI
Attached
Detach File
Event Timeline
Log In to Comment