aboutsummaryrefslogtreecommitdiffstats
path: root/fs/autofs4/expire.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/autofs4/expire.c')
-rw-r--r--fs/autofs4/expire.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/autofs4/expire.c b/fs/autofs4/expire.c
index 6a930b90d389..0571ec8352b7 100644
--- a/fs/autofs4/expire.c
+++ b/fs/autofs4/expire.c
@@ -300,6 +300,7 @@ struct dentry *autofs4_expire_direct(struct super_block *sb,
300 spin_unlock(&root->d_lock); 300 spin_unlock(&root->d_lock);
301 } 301 }
302 ino->flags |= AUTOFS_INF_EXPIRING; 302 ino->flags |= AUTOFS_INF_EXPIRING;
303 managed_dentry_set_automount(root);
303 init_completion(&ino->expire_complete); 304 init_completion(&ino->expire_complete);
304 spin_unlock(&sbi->fs_lock); 305 spin_unlock(&sbi->fs_lock);
305 return root; 306 return root;
@@ -408,6 +409,7 @@ found:
408 expired, (int)expired->d_name.len, expired->d_name.name); 409 expired, (int)expired->d_name.len, expired->d_name.name);
409 ino = autofs4_dentry_ino(expired); 410 ino = autofs4_dentry_ino(expired);
410 ino->flags |= AUTOFS_INF_EXPIRING; 411 ino->flags |= AUTOFS_INF_EXPIRING;
412 managed_dentry_set_automount(expired);
411 init_completion(&ino->expire_complete); 413 init_completion(&ino->expire_complete);
412 spin_unlock(&sbi->fs_lock); 414 spin_unlock(&sbi->fs_lock);
413 spin_lock(&autofs4_lock); 415 spin_lock(&autofs4_lock);
@@ -479,6 +481,8 @@ int autofs4_expire_run(struct super_block *sb,
479 spin_lock(&sbi->fs_lock); 481 spin_lock(&sbi->fs_lock);
480 ino = autofs4_dentry_ino(dentry); 482 ino = autofs4_dentry_ino(dentry);
481 ino->flags &= ~AUTOFS_INF_EXPIRING; 483 ino->flags &= ~AUTOFS_INF_EXPIRING;
484 if (!d_unhashed(dentry))
485 managed_dentry_clear_automount(dentry);
482 complete_all(&ino->expire_complete); 486 complete_all(&ino->expire_complete);
483 spin_unlock(&sbi->fs_lock); 487 spin_unlock(&sbi->fs_lock);
484 488
@@ -516,6 +520,8 @@ int autofs4_do_expire_multi(struct super_block *sb, struct vfsmount *mnt,
516 ino->flags &= ~AUTOFS_INF_MOUNTPOINT; 520 ino->flags &= ~AUTOFS_INF_MOUNTPOINT;
517 } 521 }
518 ino->flags &= ~AUTOFS_INF_EXPIRING; 522 ino->flags &= ~AUTOFS_INF_EXPIRING;
523 if (ret)
524 managed_dentry_clear_automount(dentry);
519 complete_all(&ino->expire_complete); 525 complete_all(&ino->expire_complete);
520 spin_unlock(&sbi->fs_lock); 526 spin_unlock(&sbi->fs_lock);
521 dput(dentry); 527 dput(dentry);