Renzo Davoli wrote:
>
> The code following this 'if' is never executed (i.e. the reap callback never
> called).
> In fact it is impossible for (engine->flags & UTRACE_EVENT(REAP)) to be
> true given that a few statement above engine->flags has been set to 0!

Good catch!

there was a recent cleanup with the small side effect ;)

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

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

--- __UTRACE/kernel/utrace.c~1_FIX_FLAGS        2009-09-06 13:35:18.000000000 
+0200
+++ __UTRACE/kernel/utrace.c    2009-09-06 15:06:27.000000000 +0200
@@ -410,12 +410,14 @@ static void utrace_reap(struct task_stru
 {
        struct utrace_engine *engine, *next;
        const struct utrace_engine_ops *ops;
+       unsigned long flags;
        LIST_HEAD(detached);
 
 restart:
        splice_attaching(utrace);
        list_for_each_entry_safe(engine, next, &utrace->attached, entry) {
                ops = engine->ops;
+               flags = engine->flags;
                engine->ops = NULL;
                engine->flags = 0;
                list_move(&engine->entry, &detached);
@@ -424,7 +426,7 @@ restart:
                 * If it didn't need a callback, we don't need to drop
                 * the lock.  Now nothing else refers to this engine.
                 */
-               if (!(engine->flags & UTRACE_EVENT(REAP)))
+               if (!(flags & UTRACE_EVENT(REAP)))
                        continue;
 
                /*

Reply via email to