From: Ian Kent Date: Wed, 22 Jun 2005 00:16:41 +0000 (-0700) Subject: [PATCH] autofs4: bad lookup fix X-Git-Tag: v2.6.13-rc4~130^2~202^2~57 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=1684b2bba6972749bc9acee57585acd6c78050b2;p=linux-2.6-omap-h63xx.git [PATCH] autofs4: bad lookup fix For browsable autofs maps, a mount request that arrives at the same time an expire is happening can fail to perform the needed mount. This happens becuase the directory exists and so the revalidate succeeds when we need it to fail so that lookup is called on the same dentry to do the mount. Instead lookup is called on the next path component which should be whithin the mount, but the parent isn't mounted. The solution is to allow the revalidate to continue and perform the mount as no directory creation (at mount time) is needed for browsable mount entries. Signed-off-by: Ian Kent Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c index e137acf0543..2a771ec6695 100644 --- a/fs/autofs4/root.c +++ b/fs/autofs4/root.c @@ -306,7 +306,14 @@ static int try_to_fill_dentry(struct dentry *dentry, DPRINTK("expire done status=%d", status); - return 0; + /* + * If the directory still exists the mount request must + * continue otherwise it can't be followed at the right + * time during the walk. + */ + status = d_invalidate(dentry); + if (status != -EBUSY) + return 0; } DPRINTK("dentry=%p %.*s ino=%p",