diff options
Diffstat (limited to 'fs/autofs4/inode.c')
-rw-r--r-- | fs/autofs4/inode.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c index 2fdcf5e1d236..7bb3e5ba0537 100644 --- a/fs/autofs4/inode.c +++ b/fs/autofs4/inode.c | |||
@@ -24,8 +24,10 @@ | |||
24 | 24 | ||
25 | static void ino_lnkfree(struct autofs_info *ino) | 25 | static void ino_lnkfree(struct autofs_info *ino) |
26 | { | 26 | { |
27 | kfree(ino->u.symlink); | 27 | if (ino->u.symlink) { |
28 | ino->u.symlink = NULL; | 28 | kfree(ino->u.symlink); |
29 | ino->u.symlink = NULL; | ||
30 | } | ||
29 | } | 31 | } |
30 | 32 | ||
31 | struct autofs_info *autofs4_init_ino(struct autofs_info *ino, | 33 | struct autofs_info *autofs4_init_ino(struct autofs_info *ino, |
@@ -41,16 +43,18 @@ struct autofs_info *autofs4_init_ino(struct autofs_info *ino, | |||
41 | if (ino == NULL) | 43 | if (ino == NULL) |
42 | return NULL; | 44 | return NULL; |
43 | 45 | ||
44 | ino->flags = 0; | 46 | if (!reinit) { |
45 | ino->mode = mode; | 47 | ino->flags = 0; |
46 | ino->inode = NULL; | 48 | ino->inode = NULL; |
47 | ino->dentry = NULL; | 49 | ino->dentry = NULL; |
48 | ino->size = 0; | 50 | ino->size = 0; |
49 | 51 | INIT_LIST_HEAD(&ino->active); | |
50 | INIT_LIST_HEAD(&ino->rehash); | 52 | INIT_LIST_HEAD(&ino->expiring); |
53 | atomic_set(&ino->count, 0); | ||
54 | } | ||
51 | 55 | ||
56 | ino->mode = mode; | ||
52 | ino->last_used = jiffies; | 57 | ino->last_used = jiffies; |
53 | atomic_set(&ino->count, 0); | ||
54 | 58 | ||
55 | ino->sbi = sbi; | 59 | ino->sbi = sbi; |
56 | 60 | ||
@@ -159,8 +163,8 @@ void autofs4_kill_sb(struct super_block *sb) | |||
159 | if (!sbi) | 163 | if (!sbi) |
160 | goto out_kill_sb; | 164 | goto out_kill_sb; |
161 | 165 | ||
162 | if (!sbi->catatonic) | 166 | /* Free wait queues, close pipe */ |
163 | autofs4_catatonic_mode(sbi); /* Free wait queues, close pipe */ | 167 | autofs4_catatonic_mode(sbi); |
164 | 168 | ||
165 | /* Clean up and release dangling references */ | 169 | /* Clean up and release dangling references */ |
166 | autofs4_force_release(sbi); | 170 | autofs4_force_release(sbi); |
@@ -338,8 +342,9 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent) | |||
338 | mutex_init(&sbi->wq_mutex); | 342 | mutex_init(&sbi->wq_mutex); |
339 | spin_lock_init(&sbi->fs_lock); | 343 | spin_lock_init(&sbi->fs_lock); |
340 | sbi->queues = NULL; | 344 | sbi->queues = NULL; |
341 | spin_lock_init(&sbi->rehash_lock); | 345 | spin_lock_init(&sbi->lookup_lock); |
342 | INIT_LIST_HEAD(&sbi->rehash_list); | 346 | INIT_LIST_HEAD(&sbi->active_list); |
347 | INIT_LIST_HEAD(&sbi->expiring_list); | ||
343 | s->s_blocksize = 1024; | 348 | s->s_blocksize = 1024; |
344 | s->s_blocksize_bits = 10; | 349 | s->s_blocksize_bits = 10; |
345 | s->s_magic = AUTOFS_SUPER_MAGIC; | 350 | s->s_magic = AUTOFS_SUPER_MAGIC; |