On 11/16, Roland McGrath wrote: > > You cited the one most obvious case: utrace_get_signal() has just run, so > finish_resume_report() has just run and everything is already as we want. > > What else?
I think, we can say that finish_resume_report() must be never called without reporting loop if ->resume = UTRACE_RESUME. > --- a/kernel/utrace.c > +++ b/kernel/utrace.c > @@ -1866,8 +1866,18 @@ void utrace_resume(struct task_struct *t > */ > report.action = start_report(utrace); > > - if (report.action == UTRACE_REPORT && > - likely(task->utrace_flags & UTRACE_EVENT(QUIESCE))) { > + switch (report.action) { > + case UTRACE_RESUME: > + /* > + * Anything we might have done was already handled by > + * utrace_get_signal(), or this is an entirely spurious > + * call. (The arch might use TIF_NOTIFY_RESUME for other > + * purposes as well as calling us.) > + */ > + return; Yes, I think this change is right. Will test and report later, but it "obviously" should fix the testing. I feel we need some cleanups, but can't suggest anything ;) And can't convince myself I am 100% sure we don't have other similar issues. At least, don't we also need the patch below? Oleg. --- a/kernel/utrace.c +++ b/kernel/utrace.c @@ -2002,7 +2002,7 @@ int utrace_get_signal(struct task_struct spin_unlock_irq(&task->sighand->siglock); } - if (resume > UTRACE_REPORT) { + if (resume > UTRACE_REPORT && utrace < UTRACE_RESUME) { /* * We only got here to process utrace->resume. * Despite no callbacks, this report is not spurious.