Skip to content

Commit

Permalink
Revert "autofs4: always use lookup for lookup"
Browse files Browse the repository at this point in the history
This reverts commit 213614d.

Alas, ->d_revalidate() can't rely on ->lookup() finishing what
it's started; if d_alloc() in do_lookup() fails, we are not going
to call ->lookup() at all.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Mar 3, 2010
1 parent 60b341b commit 4b1ae27
Show file tree
Hide file tree
Showing 4 changed files with 158 additions and 330 deletions.
7 changes: 0 additions & 7 deletions fs/autofs4/autofs_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ do { \
current->pid, __func__, ##args); \
} while (0)

struct rehash_entry {
struct task_struct *task;
struct list_head list;
};

/* Unified info structure. This is pointed to by both the dentry and
inode structures. Each file in the filesystem has an instance of this
structure. It holds a reference to the dentry, so dentries are never
Expand All @@ -81,7 +76,6 @@ struct autofs_info {

struct list_head active;
int active_count;
struct list_head rehash_list;

struct list_head expiring;

Expand All @@ -104,7 +98,6 @@ struct autofs_info {
#define AUTOFS_INF_EXPIRING (1<<0) /* dentry is in the process of expiring */
#define AUTOFS_INF_MOUNTPOINT (1<<1) /* mountpoint status for direct expire */
#define AUTOFS_INF_PENDING (1<<2) /* dentry pending mount */
#define AUTOFS_INF_REHASH (1<<3) /* dentry in transit to ->lookup() */

struct autofs_wait_queue {
wait_queue_head_t queue;
Expand Down
6 changes: 1 addition & 5 deletions fs/autofs4/expire.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ struct dentry *autofs4_expire_direct(struct super_block *sb,
root->d_mounted--;
}
ino->flags |= AUTOFS_INF_EXPIRING;
autofs4_add_expiring(root);
init_completion(&ino->expire_complete);
spin_unlock(&sbi->fs_lock);
return root;
Expand Down Expand Up @@ -407,7 +406,6 @@ struct dentry *autofs4_expire_indirect(struct super_block *sb,
expired, (int)expired->d_name.len, expired->d_name.name);
ino = autofs4_dentry_ino(expired);
ino->flags |= AUTOFS_INF_EXPIRING;
autofs4_add_expiring(expired);
init_completion(&ino->expire_complete);
spin_unlock(&sbi->fs_lock);
spin_lock(&dcache_lock);
Expand Down Expand Up @@ -435,7 +433,7 @@ int autofs4_expire_wait(struct dentry *dentry)

DPRINTK("expire done status=%d", status);

if (d_unhashed(dentry) && IS_DEADDIR(dentry->d_inode))
if (d_unhashed(dentry))
return -EAGAIN;

return status;
Expand Down Expand Up @@ -475,7 +473,6 @@ int autofs4_expire_run(struct super_block *sb,
spin_lock(&sbi->fs_lock);
ino = autofs4_dentry_ino(dentry);
ino->flags &= ~AUTOFS_INF_EXPIRING;
autofs4_del_expiring(dentry);
complete_all(&ino->expire_complete);
spin_unlock(&sbi->fs_lock);

Expand Down Expand Up @@ -506,7 +503,6 @@ int autofs4_do_expire_multi(struct super_block *sb, struct vfsmount *mnt,
ino->flags &= ~AUTOFS_INF_MOUNTPOINT;
}
ino->flags &= ~AUTOFS_INF_EXPIRING;
autofs4_del_expiring(dentry);
complete_all(&ino->expire_complete);
spin_unlock(&sbi->fs_lock);
dput(dentry);
Expand Down
1 change: 0 additions & 1 deletion fs/autofs4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ struct autofs_info *autofs4_init_ino(struct autofs_info *ino,
ino->dentry = NULL;
ino->size = 0;
INIT_LIST_HEAD(&ino->active);
INIT_LIST_HEAD(&ino->rehash_list);
ino->active_count = 0;
INIT_LIST_HEAD(&ino->expiring);
atomic_set(&ino->count, 0);
Expand Down
Loading

0 comments on commit 4b1ae27

Please sign in to comment.