lkml.org 
[lkml]   [2009]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH 4/4] forget_original_parent: cleanup ptrace pathes
    Date
    > It doesn't really hurt, but a bit ugly. Imho.

    Agreed.

    > How about below? Modulo comments and some other cleanups. For example,
    > I think it is better to move the changing of ->real_parent into
    > reparent_thread().

    The exact split between reparent_thread and forget_original_parent (and
    their names) never made much sense to me.

    If ptrace_exit does its own lock/unlock, then it could move much earlier.
    I'd be inclined to do it right before exit_signals(). But it should at
    least short-circuit and not lock for list_empty(->ptraced), so we're not
    adding a whole lock_irq/unlock_irq to the common case of no ptrace use.

    > xxx = &p->real_parent->children;
    > if (reparent_thread(father, p))
    > xxx = &child_dead;
    > list_move_tail(&p->sibling, xxx);;

    I'd thought of this before. But I didn't mention it because I was afraid
    to wonder what might care about the use of ->sibling. It really looks like
    nothing does. This is clearly the clean and nice way to go if there is no
    problem with it.

    This change and moving ptrace_exit around should probably be separate patches.


    Thanks,
    Roland


    \
     
     \ /
      Last update: 2009-02-11 00:25    [W:0.029 / U:59.868 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site