autofs4: fix waitq memory leak
commit296f7bf78bc5c7a4d772aea580ce800d14040d1a
authorIan Kent <raven@themaw.net>
Thu, 24 Jul 2008 04:30:21 +0000 (23 21:30 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 24 Jul 2008 17:47:32 +0000 (24 10:47 -0700)
tree794e3ae197d75b1a03511fefb4f87ca89caa54ac
parente64be33ccaceaca67c84237dff8805b861398eab
autofs4: fix waitq memory leak

If an autofs mount becomes catatonic before autofs4_wait_release() is
called the wait queue counter will not be decremented down to zero and the
entry will never be freed.  There are also races decrementing the wait
counter in the wait release function.  To deal with this the counter needs
to be updated while holding the wait queue mutex and waiters need to be
woken up unconditionally when the wait is removed from the queue to ensure
we eventually free the wait.

Signed-off-by: Ian Kent <raven@themaw.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/autofs4/autofs_i.h
fs/autofs4/waitq.c