ok, that is much better and clearer. I see files_struct->count field so I
assume the same idea as for p->mm and p->fs applies (assuming
p->alloc_lock is guarding p->files as well, which is confirmed by the
comment in task_struct).
>
> You can find sample code in kernel/ptrace.c + arch/i386/kernel/ptrace.c
> or fs/proc/{base,array}.c.
> If you must access a field in tsk after the read_unlock(task_lock), then
> you must use get_task_struct() + free_task_struct().
Thanks, I will redo the patch with all the above in mind. Tomorrow I will
be thinking about heavier issues you discovered.
Thanks,
Tigran
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/