On Sunday 06 July 2003 23:03, Andrew Morton wrote:
> Andrey Borzenkov <arvidjaar@xxxxxxx> wrote:
> > When devfs_lookup needs to call devfsd it arranges for other lookups for
> > the same name to wait. It is using local variable as wait queue head.
> > After devfsd returns devfs_lookup wakes up all waiters and returns.
> > Unfortunately there is no garantee all waiters will actually get chance
> > to run and clean up before devfs_lookup returns. so some of them attempt
> > to access already freed storage on stack.
> OK, but I think there is a simpler fix. We can rely on the side-effects of
> prepare_to_wait() and finish_wait().
and here is even more simple fix. there is no need to ever bother about wait
queue because it dies soon without our intervention. This is exactly what
code in 2.4 does - somebody "improved" code in 2.5 (again) :(
the patch against 2.6.0-test1 removes my previous patch and adds comment in
revalidate_wait to prevent it from hapenning again. It is basically 2.4 code
except one spinlock acquisition has been moved a bit earlier (probably does
not matter just looks better). This probably should use wake_up_all instead
of wake_up to make intention more clear.
It is tested using the same test case. Also 2.4 never had this problem as
Description: Text Data