[PATCH 07/21] Only exit workqueue after processing the shutdown work
Valerie Aurora
val at versity.com
Tue Feb 11 13:19:04 PST 2025
Remove the thread_should_return() check from the outer loop so that we
can't return without fully draining the queue.
Signed-off-by: Valerie Aurora <val at versity.com>
---
shared/lk/workqueue.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/shared/lk/workqueue.c b/shared/lk/workqueue.c
index 600e77f..5063481 100644
--- a/shared/lk/workqueue.c
+++ b/shared/lk/workqueue.c
@@ -27,8 +27,7 @@ static void workqueue_thread(struct thread *thr, void *arg)
struct cds_wfcq_node *node;
struct work_struct *work;
- while (!thread_should_return(thr)) {
-
+ for (;;) {
wait_event(&wq->waitq, !cds_wfcq_empty(&wq->head, &wq->tail) ||
thread_should_return(thr));
--
2.48.1
More information about the ngnfs-devel
mailing list