diff options
Diffstat (limited to 'fs/autofs4/expire.c')
| -rw-r--r-- | fs/autofs4/expire.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/autofs4/expire.c b/fs/autofs4/expire.c index a796c9417fb1..74bc9aa6df31 100644 --- a/fs/autofs4/expire.c +++ b/fs/autofs4/expire.c | |||
| @@ -279,6 +279,7 @@ struct dentry *autofs4_expire_direct(struct super_block *sb, | |||
| 279 | root->d_mounted--; | 279 | root->d_mounted--; |
| 280 | } | 280 | } |
| 281 | ino->flags |= AUTOFS_INF_EXPIRING; | 281 | ino->flags |= AUTOFS_INF_EXPIRING; |
| 282 | autofs4_add_expiring(root); | ||
| 282 | init_completion(&ino->expire_complete); | 283 | init_completion(&ino->expire_complete); |
| 283 | spin_unlock(&sbi->fs_lock); | 284 | spin_unlock(&sbi->fs_lock); |
| 284 | return root; | 285 | return root; |
| @@ -406,6 +407,7 @@ found: | |||
| 406 | expired, (int)expired->d_name.len, expired->d_name.name); | 407 | expired, (int)expired->d_name.len, expired->d_name.name); |
| 407 | ino = autofs4_dentry_ino(expired); | 408 | ino = autofs4_dentry_ino(expired); |
| 408 | ino->flags |= AUTOFS_INF_EXPIRING; | 409 | ino->flags |= AUTOFS_INF_EXPIRING; |
| 410 | autofs4_add_expiring(expired); | ||
| 409 | init_completion(&ino->expire_complete); | 411 | init_completion(&ino->expire_complete); |
| 410 | spin_unlock(&sbi->fs_lock); | 412 | spin_unlock(&sbi->fs_lock); |
| 411 | spin_lock(&dcache_lock); | 413 | spin_lock(&dcache_lock); |
| @@ -433,7 +435,7 @@ int autofs4_expire_wait(struct dentry *dentry) | |||
| 433 | 435 | ||
| 434 | DPRINTK("expire done status=%d", status); | 436 | DPRINTK("expire done status=%d", status); |
| 435 | 437 | ||
| 436 | if (d_unhashed(dentry)) | 438 | if (d_unhashed(dentry) && IS_DEADDIR(dentry->d_inode)) |
| 437 | return -EAGAIN; | 439 | return -EAGAIN; |
| 438 | 440 | ||
| 439 | return status; | 441 | return status; |
| @@ -473,6 +475,7 @@ int autofs4_expire_run(struct super_block *sb, | |||
| 473 | spin_lock(&sbi->fs_lock); | 475 | spin_lock(&sbi->fs_lock); |
| 474 | ino = autofs4_dentry_ino(dentry); | 476 | ino = autofs4_dentry_ino(dentry); |
| 475 | ino->flags &= ~AUTOFS_INF_EXPIRING; | 477 | ino->flags &= ~AUTOFS_INF_EXPIRING; |
| 478 | autofs4_del_expiring(dentry); | ||
| 476 | complete_all(&ino->expire_complete); | 479 | complete_all(&ino->expire_complete); |
| 477 | spin_unlock(&sbi->fs_lock); | 480 | spin_unlock(&sbi->fs_lock); |
| 478 | 481 | ||
| @@ -503,6 +506,7 @@ int autofs4_do_expire_multi(struct super_block *sb, struct vfsmount *mnt, | |||
| 503 | ino->flags &= ~AUTOFS_INF_MOUNTPOINT; | 506 | ino->flags &= ~AUTOFS_INF_MOUNTPOINT; |
| 504 | } | 507 | } |
| 505 | ino->flags &= ~AUTOFS_INF_EXPIRING; | 508 | ino->flags &= ~AUTOFS_INF_EXPIRING; |
| 509 | autofs4_del_expiring(dentry); | ||
| 506 | complete_all(&ino->expire_complete); | 510 | complete_all(&ino->expire_complete); |
| 507 | spin_unlock(&sbi->fs_lock); | 511 | spin_unlock(&sbi->fs_lock); |
| 508 | dput(dentry); | 512 | dput(dentry); |
