diff options
author | Ian Kent <raven@themaw.net> | 2009-03-31 15:24:45 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-01 08:59:23 -0700 |
commit | 8f63aaa8b9239475fc580d4450f1141496655305 (patch) | |
tree | eca8552ab842a7a2eecea104e5842f7bccadf09b /fs/Kconfig.binfmt | |
parent | 56fcef75117a153f298b3fe54af31053f53997dd (diff) |
autofs4: fix lookup deadlock
A deadlock can occur when user space uses a signal (autofs version 4 uses
SIGCHLD for this) to effect expire completion.
The order of events is:
Expire process completes, but before being able to send SIGCHLD to it's parent
...
Another process walks onto a different mount point and drops the directory
inode semaphore prior to sending the request to the daemon as it must ...
A third process does an lstat on on the expired mount point causing it to wait
on expire completion (unfortunately) holding the directory semaphore.
The mount request then arrives at the daemon which does an lstat and,
deadlock.
For some time I was concerned about releasing the directory semaphore around
the expire wait in autofs4_lookup as well as for the mount call back. I
finally realized that the last round of changes in this function made the
expiring dentry and the lookup dentry separate and distinct so the check and
possible wait can be done anywhere prior to the mount call back. This patch
moves the check to just before the mount call back and inside the directory
inode mutex release.
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>
Diffstat (limited to 'fs/Kconfig.binfmt')
0 files changed, 0 insertions, 0 deletions