Re: [patch-2.4.0-test5-pre1] nullfs and forced umount

From: Tigran Aivazian (tigran@veritas.com)
Date: Tue Jul 18 2000 - 13:43:54 EST


On Tue, 18 Jul 2000, Tigran Aivazian wrote:
> repeat:
> read_lock(&tasklist_lock);
> for_each_task(p) {
> blabla, need to block next
> task_lock(p);
> get_task_struct(p);
> task_unlock(p);
> read_unlock(&tasklist_lock);
> block and manipulate p
> goto repeat;
> }

actually, the above is wrong - there is no need for task_lock/unlock
around get_task_struct because the count is atomic. Also, where is
put_task_struct() (which should atomic_dec() the same count).

regards,
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/



This archive was generated by hypermail 2b29 : Sun Jul 23 2000 - 21:00:11 EST