aboutsummaryrefslogtreecommitdiffstats
path: root/fs/autofs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/autofs')
-rw-r--r--fs/autofs/autofs_i.h1
-rw-r--r--fs/autofs/dirhash.c1
-rw-r--r--fs/autofs/init.c2
-rw-r--r--fs/autofs/inode.c19
-rw-r--r--fs/autofs/root.c4
-rw-r--r--fs/autofs/waitq.c1
6 files changed, 21 insertions, 7 deletions
diff --git a/fs/autofs/autofs_i.h b/fs/autofs/autofs_i.h
index c7700d9b3f96..906ba5ce2261 100644
--- a/fs/autofs/autofs_i.h
+++ b/fs/autofs/autofs_i.h
@@ -149,6 +149,7 @@ extern const struct file_operations autofs_root_operations;
149/* Initializing function */ 149/* Initializing function */
150 150
151int autofs_fill_super(struct super_block *, void *, int); 151int autofs_fill_super(struct super_block *, void *, int);
152void autofs_kill_sb(struct super_block *sb);
152 153
153/* Queue management functions */ 154/* Queue management functions */
154 155
diff --git a/fs/autofs/dirhash.c b/fs/autofs/dirhash.c
index 3fded389d06b..bf8c8af98004 100644
--- a/fs/autofs/dirhash.c
+++ b/fs/autofs/dirhash.c
@@ -246,5 +246,4 @@ void autofs_hash_nuke(struct autofs_sb_info *sbi)
246 kfree(ent); 246 kfree(ent);
247 } 247 }
248 } 248 }
249 shrink_dcache_sb(sbi->sb);
250} 249}
diff --git a/fs/autofs/init.c b/fs/autofs/init.c
index aca123752406..cea5219b4f37 100644
--- a/fs/autofs/init.c
+++ b/fs/autofs/init.c
@@ -24,7 +24,7 @@ static struct file_system_type autofs_fs_type = {
24 .owner = THIS_MODULE, 24 .owner = THIS_MODULE,
25 .name = "autofs", 25 .name = "autofs",
26 .get_sb = autofs_get_sb, 26 .get_sb = autofs_get_sb,
27 .kill_sb = kill_anon_super, 27 .kill_sb = autofs_kill_sb,
28}; 28};
29 29
30static int __init init_autofs_fs(void) 30static int __init init_autofs_fs(void)
diff --git a/fs/autofs/inode.c b/fs/autofs/inode.c
index 2c9759baad61..f968d1342808 100644
--- a/fs/autofs/inode.c
+++ b/fs/autofs/inode.c
@@ -20,11 +20,20 @@
20#include "autofs_i.h" 20#include "autofs_i.h"
21#include <linux/module.h> 21#include <linux/module.h>
22 22
23static void autofs_put_super(struct super_block *sb) 23void autofs_kill_sb(struct super_block *sb)
24{ 24{
25 struct autofs_sb_info *sbi = autofs_sbi(sb); 25 struct autofs_sb_info *sbi = autofs_sbi(sb);
26 unsigned int n; 26 unsigned int n;
27 27
28 /*
29 * In the event of a failure in get_sb_nodev the superblock
30 * info is not present so nothing else has been setup, so
31 * just call kill_anon_super when we are called from
32 * deactivate_super.
33 */
34 if (!sbi)
35 goto out_kill_sb;
36
28 if ( !sbi->catatonic ) 37 if ( !sbi->catatonic )
29 autofs_catatonic_mode(sbi); /* Free wait queues, close pipe */ 38 autofs_catatonic_mode(sbi); /* Free wait queues, close pipe */
30 39
@@ -36,14 +45,15 @@ static void autofs_put_super(struct super_block *sb)
36 45
37 kfree(sb->s_fs_info); 46 kfree(sb->s_fs_info);
38 47
48out_kill_sb:
39 DPRINTK(("autofs: shutting down\n")); 49 DPRINTK(("autofs: shutting down\n"));
50 kill_anon_super(sb);
40} 51}
41 52
42static void autofs_read_inode(struct inode *inode); 53static void autofs_read_inode(struct inode *inode);
43 54
44static struct super_operations autofs_sops = { 55static struct super_operations autofs_sops = {
45 .read_inode = autofs_read_inode, 56 .read_inode = autofs_read_inode,
46 .put_super = autofs_put_super,
47 .statfs = simple_statfs, 57 .statfs = simple_statfs,
48}; 58};
49 59
@@ -136,7 +146,8 @@ int autofs_fill_super(struct super_block *s, void *data, int silent)
136 146
137 s->s_fs_info = sbi; 147 s->s_fs_info = sbi;
138 sbi->magic = AUTOFS_SBI_MAGIC; 148 sbi->magic = AUTOFS_SBI_MAGIC;
139 sbi->catatonic = 0; 149 sbi->pipe = NULL;
150 sbi->catatonic = 1;
140 sbi->exp_timeout = 0; 151 sbi->exp_timeout = 0;
141 sbi->oz_pgrp = process_group(current); 152 sbi->oz_pgrp = process_group(current);
142 autofs_initialize_hash(&sbi->dirhash); 153 autofs_initialize_hash(&sbi->dirhash);
@@ -180,6 +191,7 @@ int autofs_fill_super(struct super_block *s, void *data, int silent)
180 if ( !pipe->f_op || !pipe->f_op->write ) 191 if ( !pipe->f_op || !pipe->f_op->write )
181 goto fail_fput; 192 goto fail_fput;
182 sbi->pipe = pipe; 193 sbi->pipe = pipe;
194 sbi->catatonic = 0;
183 195
184 /* 196 /*
185 * Success! Install the root dentry now to indicate completion. 197 * Success! Install the root dentry now to indicate completion.
@@ -198,6 +210,7 @@ fail_iput:
198 iput(root_inode); 210 iput(root_inode);
199fail_free: 211fail_free:
200 kfree(sbi); 212 kfree(sbi);
213 s->s_fs_info = NULL;
201fail_unlock: 214fail_unlock:
202 return -EINVAL; 215 return -EINVAL;
203} 216}
diff --git a/fs/autofs/root.c b/fs/autofs/root.c
index 368a1c33a3c8..e698c51d2b02 100644
--- a/fs/autofs/root.c
+++ b/fs/autofs/root.c
@@ -45,7 +45,7 @@ static int autofs_root_readdir(struct file *filp, void *dirent, filldir_t filldi
45 struct autofs_dir_ent *ent = NULL; 45 struct autofs_dir_ent *ent = NULL;
46 struct autofs_dirhash *dirhash; 46 struct autofs_dirhash *dirhash;
47 struct autofs_sb_info *sbi; 47 struct autofs_sb_info *sbi;
48 struct inode * inode = filp->f_dentry->d_inode; 48 struct inode * inode = filp->f_path.dentry->d_inode;
49 off_t onr, nr; 49 off_t onr, nr;
50 50
51 lock_kernel(); 51 lock_kernel();
@@ -557,7 +557,7 @@ static int autofs_root_ioctl(struct inode *inode, struct file *filp,
557 case AUTOFS_IOC_SETTIMEOUT: 557 case AUTOFS_IOC_SETTIMEOUT:
558 return autofs_get_set_timeout(sbi, argp); 558 return autofs_get_set_timeout(sbi, argp);
559 case AUTOFS_IOC_EXPIRE: 559 case AUTOFS_IOC_EXPIRE:
560 return autofs_expire_run(inode->i_sb, sbi, filp->f_vfsmnt, 560 return autofs_expire_run(inode->i_sb, sbi, filp->f_path.mnt,
561 argp); 561 argp);
562 default: 562 default:
563 return -ENOSYS; 563 return -ENOSYS;
diff --git a/fs/autofs/waitq.c b/fs/autofs/waitq.c
index 633f628005b4..19a9cafb5ddf 100644
--- a/fs/autofs/waitq.c
+++ b/fs/autofs/waitq.c
@@ -41,6 +41,7 @@ void autofs_catatonic_mode(struct autofs_sb_info *sbi)
41 wq = nwq; 41 wq = nwq;
42 } 42 }
43 fput(sbi->pipe); /* Close the pipe */ 43 fput(sbi->pipe); /* Close the pipe */
44 sbi->pipe = NULL;
44 autofs_hash_dputall(&sbi->dirhash); /* Remove all dentry pointers */ 45 autofs_hash_dputall(&sbi->dirhash); /* Remove all dentry pointers */
45} 46}
46 47