diff options
author | Ian Kent <raven@themaw.net> | 2011-03-24 13:51:08 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-03-24 14:54:34 -0400 |
commit | 3c3199852905ceb90a70e98777e71d369a5f0823 (patch) | |
tree | aec40f3721955394587fc4ad364606161bc98cc5 /fs/autofs4/expire.c | |
parent | 62a7375e5d77d654695297c4b39d5d740d901184 (diff) |
autofs4 - reinstate last used update on access
When direct (and offset) mounts were introduced the the last used
timeout could no longer be updated in ->d_revalidate(). This is
because covered direct mounts would be followed over without calling
the autofs file system. As a result the definition of the busyness
check for all entries was changed to be "actually busy" being an open
file or working directory within the automount. But now we have a call
back in the follow so the last used update on any access can be
re-instated. This requires DCACHE_MANAGE_TRANSIT to always be set.
Signed-off-by: Ian Kent <raven@themaw.net>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/autofs4/expire.c')
-rw-r--r-- | fs/autofs4/expire.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/fs/autofs4/expire.c b/fs/autofs4/expire.c index f43100b9662b..c896dd6c1ea9 100644 --- a/fs/autofs4/expire.c +++ b/fs/autofs4/expire.c | |||
@@ -294,7 +294,6 @@ struct dentry *autofs4_expire_direct(struct super_block *sb, | |||
294 | spin_unlock(&sbi->fs_lock); | 294 | spin_unlock(&sbi->fs_lock); |
295 | return NULL; | 295 | return NULL; |
296 | } | 296 | } |
297 | managed_dentry_set_transit(root); | ||
298 | if (!autofs4_direct_busy(mnt, root, timeout, do_now)) { | 297 | if (!autofs4_direct_busy(mnt, root, timeout, do_now)) { |
299 | struct autofs_info *ino = autofs4_dentry_ino(root); | 298 | struct autofs_info *ino = autofs4_dentry_ino(root); |
300 | ino->flags |= AUTOFS_INF_EXPIRING; | 299 | ino->flags |= AUTOFS_INF_EXPIRING; |
@@ -302,7 +301,6 @@ struct dentry *autofs4_expire_direct(struct super_block *sb, | |||
302 | spin_unlock(&sbi->fs_lock); | 301 | spin_unlock(&sbi->fs_lock); |
303 | return root; | 302 | return root; |
304 | } | 303 | } |
305 | managed_dentry_clear_transit(root); | ||
306 | spin_unlock(&sbi->fs_lock); | 304 | spin_unlock(&sbi->fs_lock); |
307 | dput(root); | 305 | dput(root); |
308 | 306 | ||
@@ -341,8 +339,7 @@ struct dentry *autofs4_expire_indirect(struct super_block *sb, | |||
341 | ino = autofs4_dentry_ino(dentry); | 339 | ino = autofs4_dentry_ino(dentry); |
342 | /* No point expiring a pending mount */ | 340 | /* No point expiring a pending mount */ |
343 | if (ino->flags & AUTOFS_INF_PENDING) | 341 | if (ino->flags & AUTOFS_INF_PENDING) |
344 | goto cont; | 342 | goto next; |
345 | managed_dentry_set_transit(dentry); | ||
346 | 343 | ||
347 | /* | 344 | /* |
348 | * Case 1: (i) indirect mount or top level pseudo direct mount | 345 | * Case 1: (i) indirect mount or top level pseudo direct mount |
@@ -402,8 +399,6 @@ struct dentry *autofs4_expire_indirect(struct super_block *sb, | |||
402 | } | 399 | } |
403 | } | 400 | } |
404 | next: | 401 | next: |
405 | managed_dentry_clear_transit(dentry); | ||
406 | cont: | ||
407 | spin_unlock(&sbi->fs_lock); | 402 | spin_unlock(&sbi->fs_lock); |
408 | } | 403 | } |
409 | return NULL; | 404 | return NULL; |
@@ -484,8 +479,6 @@ int autofs4_expire_run(struct super_block *sb, | |||
484 | spin_lock(&sbi->fs_lock); | 479 | spin_lock(&sbi->fs_lock); |
485 | ino = autofs4_dentry_ino(dentry); | 480 | ino = autofs4_dentry_ino(dentry); |
486 | ino->flags &= ~AUTOFS_INF_EXPIRING; | 481 | ino->flags &= ~AUTOFS_INF_EXPIRING; |
487 | if (!d_unhashed(dentry)) | ||
488 | managed_dentry_clear_transit(dentry); | ||
489 | complete_all(&ino->expire_complete); | 482 | complete_all(&ino->expire_complete); |
490 | spin_unlock(&sbi->fs_lock); | 483 | spin_unlock(&sbi->fs_lock); |
491 | 484 | ||
@@ -513,9 +506,7 @@ int autofs4_do_expire_multi(struct super_block *sb, struct vfsmount *mnt, | |||
513 | spin_lock(&sbi->fs_lock); | 506 | spin_lock(&sbi->fs_lock); |
514 | ino->flags &= ~AUTOFS_INF_EXPIRING; | 507 | ino->flags &= ~AUTOFS_INF_EXPIRING; |
515 | spin_lock(&dentry->d_lock); | 508 | spin_lock(&dentry->d_lock); |
516 | if (ret) | 509 | if (!ret) { |
517 | __managed_dentry_clear_transit(dentry); | ||
518 | else { | ||
519 | if ((IS_ROOT(dentry) || | 510 | if ((IS_ROOT(dentry) || |
520 | (autofs_type_indirect(sbi->type) && | 511 | (autofs_type_indirect(sbi->type) && |
521 | IS_ROOT(dentry->d_parent))) && | 512 | IS_ROOT(dentry->d_parent))) && |