Andrew Morton wrote: >Manfred Spraul wrote: > > >>__unhash_process acquires the dcache_lock while holding the >>tasklist_lock for writing. This can deadlock. While trying to fix that >>race, I found further races with proc_dentry. >>The attached patch (hopefully) fixes all these races. >> >>Changes: >>- fs/proc/base.c assumed that p->pid is reset to 0 during exit. This is >>not the case anymore. I now look at the count of the pid structure for >>PIDTYPE_PID. >>- pid_delete_dentry and pid_revalidate removed. The implementation >>didn't work, and noone complained. >>- only d_add the new proc entry if the task is still valid: d_add+d_drop >>is a race, if a lookup happens between both calls. >>- add a new spinlock that protects proc_dentry. >> >> > >Did you send the correct patch? > > Yes, but my diff script was incomplete :-( >kernel/exit.c: In function `release_task': >kernel/exit.c:59: warning: implicit declaration of function `proc_pid_unhash' > Missing updates to >kernel/exit.c:59: warning: assignment makes pointer from integer without a cast >kernel/exit.c:86: warning: implicit declaration of function `proc_pid_flush' >kernel/exit.c: In function `unhash_process': >kernel/exit.c:95: warning: `proc_dentry' might be used uninitialized in this function > And this one is a fatal error: proc_dentry remained uninitialized, and that crashes during smp boot. New patch attached. Changelog unchanged. -- Manfred