]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
[PATCH] autofs4: fix another race between mount and expire
authorIan Kent <raven@themaw.net>
Tue, 20 Feb 2007 21:58:10 +0000 (13:58 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 21 Feb 2007 01:10:15 +0000 (17:10 -0800)
commitf50b6f8691cae2e0064c499dd3ef3f31142987f0
tree56c449af977772a42939afde5230c4809a057ffe
parente8514478f63b95548a49576ba96b47edeb8596e0
[PATCH] autofs4: fix another race between mount and expire

Jeff Moyer has identified a race between mount and expire.

What happens is that during an expire the situation can arise that a directory
is removed and another lookup is done before the expire issues a completion
status to the kernel module.  In this case, since the the lookup gets a new
dentry, it doesn't know that there is an expire in progress and when it posts
its mount request, matches the existing expire request and waits for its
completion.  ENOENT is then returned to user space from lookup (as the dentry
passed in is now unhashed) without having performed the mount request.

The solution used here is to keep track of dentrys in this unhashed state and
reuse them, if possible, in order to preserve the flags.  Additionally, this
infrastructure will provide the framework for the reintroduction of caching of
mount fails removed earlier in development.

Signed-off-by: Ian Kent <raven@themaw.net>
Acked-by: Jeff Moyer <jmoyer@redhat.com>
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/inode.c
fs/autofs4/root.c