lkml.org 
[lkml]   [2002]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectIs this racy?
    In fs/proc/array.c (2.4.20-pre9, 2.4.19 and likely many other
    versions) in function 'proc_pid_stat()' there is a code like that:

    ......
    read_lock(&tasklist_lock);
    ppid = task->pid ? task->p_opptr->pid : 0;
    read_unlock(&tasklist_lock);
    res = sprintf(buffer,"<long format string>",
    task->pid,
    ......
    ppid,
    ......

    So assignment to ppid is locked but other reads from fiels of 'task'
    structure are not guarded that way. Is this ok or if not we do not
    particularly care? Function 'task_state()' in the same file seems
    to be more careful about this.

    Michal

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 13:29    [W:0.044 / U:0.684 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site