aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/autofs4/expire.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/autofs4/expire.c b/fs/autofs4/expire.c
index d03bedc7369f..af141fc8cfe6 100644
--- a/fs/autofs4/expire.c
+++ b/fs/autofs4/expire.c
@@ -30,12 +30,6 @@ static inline int autofs4_can_expire(struct dentry *dentry,
30 /* Too young to die */ 30 /* Too young to die */
31 if (!timeout || time_after(ino->last_used + timeout, now)) 31 if (!timeout || time_after(ino->last_used + timeout, now))
32 return 0; 32 return 0;
33
34 /* update last_used here :-
35 - obviously makes sense if it is in use now
36 - less obviously, prevents rapid-fire expire
37 attempts if expire fails the first time */
38 ino->last_used = now;
39 } 33 }
40 return 1; 34 return 1;
41} 35}
@@ -535,6 +529,8 @@ int autofs4_expire_run(struct super_block *sb,
535 529
536 spin_lock(&sbi->fs_lock); 530 spin_lock(&sbi->fs_lock);
537 ino = autofs4_dentry_ino(dentry); 531 ino = autofs4_dentry_ino(dentry);
532 /* avoid rapid-fire expire attempts if expiry fails */
533 ino->last_used = now;
538 ino->flags &= ~AUTOFS_INF_EXPIRING; 534 ino->flags &= ~AUTOFS_INF_EXPIRING;
539 complete_all(&ino->expire_complete); 535 complete_all(&ino->expire_complete);
540 spin_unlock(&sbi->fs_lock); 536 spin_unlock(&sbi->fs_lock);
@@ -561,6 +557,8 @@ int autofs4_do_expire_multi(struct super_block *sb, struct vfsmount *mnt,
561 ret = autofs4_wait(sbi, dentry, NFY_EXPIRE); 557 ret = autofs4_wait(sbi, dentry, NFY_EXPIRE);
562 558
563 spin_lock(&sbi->fs_lock); 559 spin_lock(&sbi->fs_lock);
560 /* avoid rapid-fire expire attempts if expiry fails */
561 ino->last_used = now;
564 ino->flags &= ~AUTOFS_INF_EXPIRING; 562 ino->flags &= ~AUTOFS_INF_EXPIRING;
565 complete_all(&ino->expire_complete); 563 complete_all(&ino->expire_complete);
566 spin_unlock(&sbi->fs_lock); 564 spin_unlock(&sbi->fs_lock);