utrace_resume()->start_callback() can return without clearing
->reporting, this is very wrong. The bug was introduced by me in
47c593ee "avoid the unnecessary utrace_resume()->utrace_reset()"
commit.

Revert this patch and change start_callback() to check event right
after we call ->report_quiesce(). If it is zero we can just clear
->spurious and return without playing with ->reporting and ->flags.
No need to worry about ENGINE_STOP, finish_callback() has already
updated engine->flags and report->action correctly.

Signed-off-by: Oleg Nesterov <o...@redhat.com>
---

 kernel/utrace.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

--- kstub/kernel/utrace.c~10_47c593ee_fix       2010-10-11 12:48:51.000000000 
+0200
+++ kstub/kernel/utrace.c       2010-10-12 21:19:33.000000000 +0200
@@ -1528,6 +1528,12 @@ static const struct utrace_engine_ops *s
                                                           engine, event)))
                        return NULL;
 
+               if (!event) {
+                       /* We only got here to report QUIESCE */
+                       report->spurious = false;
+                       return NULL;
+               }
+
                /*
                 * finish_callback() reset utrace->reporting after the
                 * quiesce callback.  Now we set it again (as above)
@@ -1543,7 +1549,7 @@ static const struct utrace_engine_ops *s
        if (want & ENGINE_STOP)
                report->action = UTRACE_STOP;
 
-       if (want & (event ?: UTRACE_EVENT(QUIESCE))) {
+       if (want & event) {
                report->spurious = false;
                return ops;
        }

Reply via email to