> Tracee, finish_callback() path:
> 
>       if (action == UTRACE_DETACH)
>               engine->ops = utrace_detached_ops;
> 
>       utrace->reporting = NULL;
> 
> no barries, no utrace->lock() in between.
> 
> Tracer, utrace_barrier() under utrace->lock:
> 
>       if (engine->ops == utrace_detached_ops)
>               return -EXXX;
> 
>       if (utrace->reporting != engine)
>               return 0;
> 
> Afaics, this is racy and should be fixed in utrace level.

Let me see if I'm following you.  The scenario you mean is that
utrace_barrier() returns zero when there had been a callback in
progress but it returned UTRACE_DETACH, and so now the engine is
detached.  The only guarantee utrace_barrier() claims is ordering
with respect to the effects of prior utrace_* calls, and a callback
not being in progress right now.  This scenario meets that interface
contract as stated.  It's as if utrace_barrier() had returned zero
before that callback ran.

But you can tell by external means that your callback has started
before you called utrace_barrier(), so you want it to return -ESRCH
instead of 0.  Is that right?  Which external means?


Thanks,
Roland

Reply via email to