diff options
author | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-11-22 13:06:44 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-11-22 13:06:44 -0500 |
commit | 0bd2af46839ad6262d25714a6ec0365db9d6b98f (patch) | |
tree | dcced72d230d69fd0c5816ac6dd03ab84799a93e /fs/autofs/inode.c | |
parent | e138a5d2356729b8752e88520cc1525fae9794ac (diff) | |
parent | f26b90440cd74c78fe10c9bd5160809704a9627c (diff) |
Merge ../scsi-rc-fixes-2.6
Diffstat (limited to 'fs/autofs/inode.c')
-rw-r--r-- | fs/autofs/inode.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/fs/autofs/inode.c b/fs/autofs/inode.c index 2c9759baad61..38ede5c9d6fd 100644 --- a/fs/autofs/inode.c +++ b/fs/autofs/inode.c | |||
@@ -20,11 +20,19 @@ | |||
20 | #include "autofs_i.h" | 20 | #include "autofs_i.h" |
21 | #include <linux/module.h> | 21 | #include <linux/module.h> |
22 | 22 | ||
23 | static void autofs_put_super(struct super_block *sb) | 23 | void 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 exit when we are called from deactivate_super. | ||
32 | */ | ||
33 | if (!sbi) | ||
34 | return; | ||
35 | |||
28 | if ( !sbi->catatonic ) | 36 | if ( !sbi->catatonic ) |
29 | autofs_catatonic_mode(sbi); /* Free wait queues, close pipe */ | 37 | autofs_catatonic_mode(sbi); /* Free wait queues, close pipe */ |
30 | 38 | ||
@@ -37,13 +45,13 @@ static void autofs_put_super(struct super_block *sb) | |||
37 | kfree(sb->s_fs_info); | 45 | kfree(sb->s_fs_info); |
38 | 46 | ||
39 | DPRINTK(("autofs: shutting down\n")); | 47 | DPRINTK(("autofs: shutting down\n")); |
48 | kill_anon_super(sb); | ||
40 | } | 49 | } |
41 | 50 | ||
42 | static void autofs_read_inode(struct inode *inode); | 51 | static void autofs_read_inode(struct inode *inode); |
43 | 52 | ||
44 | static struct super_operations autofs_sops = { | 53 | static struct super_operations autofs_sops = { |
45 | .read_inode = autofs_read_inode, | 54 | .read_inode = autofs_read_inode, |
46 | .put_super = autofs_put_super, | ||
47 | .statfs = simple_statfs, | 55 | .statfs = simple_statfs, |
48 | }; | 56 | }; |
49 | 57 | ||
@@ -136,7 +144,8 @@ int autofs_fill_super(struct super_block *s, void *data, int silent) | |||
136 | 144 | ||
137 | s->s_fs_info = sbi; | 145 | s->s_fs_info = sbi; |
138 | sbi->magic = AUTOFS_SBI_MAGIC; | 146 | sbi->magic = AUTOFS_SBI_MAGIC; |
139 | sbi->catatonic = 0; | 147 | sbi->pipe = NULL; |
148 | sbi->catatonic = 1; | ||
140 | sbi->exp_timeout = 0; | 149 | sbi->exp_timeout = 0; |
141 | sbi->oz_pgrp = process_group(current); | 150 | sbi->oz_pgrp = process_group(current); |
142 | autofs_initialize_hash(&sbi->dirhash); | 151 | autofs_initialize_hash(&sbi->dirhash); |
@@ -180,6 +189,7 @@ int autofs_fill_super(struct super_block *s, void *data, int silent) | |||
180 | if ( !pipe->f_op || !pipe->f_op->write ) | 189 | if ( !pipe->f_op || !pipe->f_op->write ) |
181 | goto fail_fput; | 190 | goto fail_fput; |
182 | sbi->pipe = pipe; | 191 | sbi->pipe = pipe; |
192 | sbi->catatonic = 0; | ||
183 | 193 | ||
184 | /* | 194 | /* |
185 | * Success! Install the root dentry now to indicate completion. | 195 | * Success! Install the root dentry now to indicate completion. |
@@ -198,6 +208,8 @@ fail_iput: | |||
198 | iput(root_inode); | 208 | iput(root_inode); |
199 | fail_free: | 209 | fail_free: |
200 | kfree(sbi); | 210 | kfree(sbi); |
211 | s->s_fs_info = NULL; | ||
212 | kill_anon_super(s); | ||
201 | fail_unlock: | 213 | fail_unlock: |
202 | return -EINVAL; | 214 | return -EINVAL; |
203 | } | 215 | } |