aboutsummaryrefslogtreecommitdiffstats
path: root/fs/autofs4
diff options
context:
space:
mode:
authorJeff Moyer <jmoyer@redhat.com>2008-05-01 07:35:09 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-05-01 11:04:01 -0400
commit9d2de6ad2a78bb8b60bf7a54e6043dca44e9a801 (patch)
tree6e5b7aea51d739ba0e26e4d795d53093ded3933a /fs/autofs4
parent033790449ba9c4dcf8478a87693d33df625c23b5 (diff)
autofs4: fix incorrect return from root.c:try_to_fill_dentry()
Jeff Moyer has identified a case where the autofs4 function root.c:try_to_fill_dentry() can return -EBUSY when it should return 0. Jeff's description of the way this happens is: "automount starts an expire for directory d. after the callout to the daemon, but before the rmdir, another process tries to walk into the same directory. It puts itself onto the waitq, pending the expiration. When the expire finishes, the second process is woken up. In try_to_fill_dentry, it does this check: status = d_invalidate(dentry); if (status != -EBUSY) return -EAGAIN; And status is EBUSY. The dentry still has a non-zero d_inode, and the flags do not contain LOOKUP_CONTINUE or LOOKUP_DIRECTORY So, we fall through and return -EBUSY to the caller." Signed-off-by: Jeff Moyer <jmoyer@redhat.com> 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/autofs4')
-rw-r--r--fs/autofs4/root.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index 0533d37c73ae..6e250030a690 100644
--- a/fs/autofs4/root.c
+++ b/fs/autofs4/root.c
@@ -243,7 +243,7 @@ static int try_to_fill_dentry(struct dentry *dentry, int flags)
243 struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb); 243 struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
244 struct autofs_info *ino = autofs4_dentry_ino(dentry); 244 struct autofs_info *ino = autofs4_dentry_ino(dentry);
245 struct dentry *new; 245 struct dentry *new;
246 int status = 0; 246 int status;
247 247
248 /* Block on any pending expiry here; invalidate the dentry 248 /* Block on any pending expiry here; invalidate the dentry
249 when expiration is done to trigger mount request with a new 249 when expiration is done to trigger mount request with a new
@@ -340,7 +340,7 @@ static int try_to_fill_dentry(struct dentry *dentry, int flags)
340 } 340 }
341 } 341 }
342 342
343 return status; 343 return 0;
344} 344}
345 345
346/* For autofs direct mounts the follow link triggers the mount */ 346/* For autofs direct mounts the follow link triggers the mount */