Commit 1684b2bba6972749bc9acee57585acd6c78050b2

Authored by Ian Kent
Committed by Linus Torvalds
1 parent cc9acc8858

[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 <raven@themaw.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 1 changed file with 8 additions and 1 deletions Side-by-side Diff

... ... @@ -306,7 +306,14 @@
306 306  
307 307 DPRINTK("expire done status=%d", status);
308 308  
309   - return 0;
  309 + /*
  310 + * If the directory still exists the mount request must
  311 + * continue otherwise it can't be followed at the right
  312 + * time during the walk.
  313 + */
  314 + status = d_invalidate(dentry);
  315 + if (status != -EBUSY)
  316 + return 0;
310 317 }
311 318  
312 319 DPRINTK("dentry=%p %.*s ino=%p",