diff options
author | hselasky <hselasky@FreeBSD.org> | 2018-03-04 19:15:24 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2018-03-04 19:15:24 +0000 |
commit | 86fe858a69210d5a721c27fa71f8eb9368b40c19 (patch) | |
tree | 2a79bb90ba93edabbbcb003de11deca58da9eeec /sys/compat | |
parent | 4812df02b4291a2f3f530373d921c944df33bed3 (diff) | |
download | FreeBSD-src-86fe858a69210d5a721c27fa71f8eb9368b40c19.zip FreeBSD-src-86fe858a69210d5a721c27fa71f8eb9368b40c19.tar.gz |
MFC r330236:
Correct the return value from flush_work() and flush_delayed_work() in the
LinuxKPI to comply more with Linux. This fixes an issue when these functions
are used in waiting loops.
Sponsored by: Mellanox Technologies
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/linuxkpi/common/src/linux_work.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/compat/linuxkpi/common/src/linux_work.c b/sys/compat/linuxkpi/common/src/linux_work.c index 76d3a22..b42b14d 100644 --- a/sys/compat/linuxkpi/common/src/linux_work.c +++ b/sys/compat/linuxkpi/common/src/linux_work.c @@ -454,6 +454,7 @@ bool linux_flush_work(struct work_struct *work) { struct taskqueue *tq; + int retval; WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "linux_flush_work() might sleep"); @@ -463,8 +464,9 @@ linux_flush_work(struct work_struct *work) return (0); default: tq = work->work_queue->taskqueue; + retval = taskqueue_poll_is_busy(tq, &work->work_task); taskqueue_drain(tq, &work->work_task); - return (1); + return (retval); } } @@ -477,6 +479,7 @@ bool linux_flush_delayed_work(struct delayed_work *dwork) { struct taskqueue *tq; + int retval; WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "linux_flush_delayed_work() might sleep"); @@ -490,8 +493,9 @@ linux_flush_delayed_work(struct delayed_work *dwork) /* FALLTHROUGH */ default: tq = dwork->work.work_queue->taskqueue; + retval = taskqueue_poll_is_busy(tq, &dwork->work.work_task); taskqueue_drain(tq, &dwork->work.work_task); - return (1); + return (retval); } } |