projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[powerpc.git]
/
fs
/
autofs4
/
inode.c
diff --git
a/fs/autofs4/inode.c
b/fs/autofs4/inode.c
index
11a6a9a
..
ce7c0f1
100644
(file)
--- a/
fs/autofs4/inode.c
+++ b/
fs/autofs4/inode.c
@@
-96,9
+96,12
@@
void autofs4_free_ino(struct autofs_info *ino)
*/
static void autofs4_force_release(struct autofs_sb_info *sbi)
{
*/
static void autofs4_force_release(struct autofs_sb_info *sbi)
{
- struct dentry *this_parent = sbi->root;
+ struct dentry *this_parent = sbi->
sb->s_
root;
struct list_head *next;
struct list_head *next;
+ if (!sbi->sb->s_root)
+ return;
+
spin_lock(&dcache_lock);
repeat:
next = this_parent->d_subdirs.next;
spin_lock(&dcache_lock);
repeat:
next = this_parent->d_subdirs.next;
@@
-127,7
+130,7
@@
resume:
spin_lock(&dcache_lock);
}
spin_lock(&dcache_lock);
}
- if (this_parent != sbi->root) {
+ if (this_parent != sbi->
sb->s_
root) {
struct dentry *dentry = this_parent;
next = this_parent->d_u.d_child.next;
struct dentry *dentry = this_parent;
next = this_parent->d_u.d_child.next;
@@
-140,18
+143,20
@@
resume:
goto resume;
}
spin_unlock(&dcache_lock);
goto resume;
}
spin_unlock(&dcache_lock);
-
- dput(sbi->root);
- sbi->root = NULL;
- shrink_dcache_sb(sbi->sb);
-
- return;
}
}
-
static void autofs4_put_super
(struct super_block *sb)
+
void autofs4_kill_sb
(struct super_block *sb)
{
struct autofs_sb_info *sbi = autofs4_sbi(sb);
{
struct autofs_sb_info *sbi = autofs4_sbi(sb);
+ /*
+ * In the event of a failure in get_sb_nodev the superblock
+ * info is not present so nothing else has been setup, so
+ * just exit when we are called from deactivate_super.
+ */
+ if (!sbi)
+ return;
+
sb->s_fs_info = NULL;
if ( !sbi->catatonic )
sb->s_fs_info = NULL;
if ( !sbi->catatonic )
@@
-163,6
+168,7
@@
static void autofs4_put_super(struct super_block *sb)
kfree(sbi);
DPRINTK("shutting down");
kfree(sbi);
DPRINTK("shutting down");
+ kill_anon_super(sb);
}
static int autofs4_show_options(struct seq_file *m, struct vfsmount *mnt)
}
static int autofs4_show_options(struct seq_file *m, struct vfsmount *mnt)
@@
-189,7
+195,6
@@
static int autofs4_show_options(struct seq_file *m, struct vfsmount *mnt)
}
static struct super_operations autofs4_sops = {
}
static struct super_operations autofs4_sops = {
- .put_super = autofs4_put_super,
.statfs = simple_statfs,
.show_options = autofs4_show_options,
};
.statfs = simple_statfs,
.show_options = autofs4_show_options,
};
@@
-315,9
+320,9
@@
int autofs4_fill_super(struct super_block *s, void *data, int silent)
s->s_fs_info = sbi;
sbi->magic = AUTOFS_SBI_MAGIC;
s->s_fs_info = sbi;
sbi->magic = AUTOFS_SBI_MAGIC;
- sbi->root = NULL;
sbi->pipefd = -1;
sbi->pipefd = -1;
- sbi->catatonic = 0;
+ sbi->pipe = NULL;
+ sbi->catatonic = 1;
sbi->exp_timeout = 0;
sbi->oz_pgrp = process_group(current);
sbi->sb = s;
sbi->exp_timeout = 0;
sbi->oz_pgrp = process_group(current);
sbi->sb = s;
@@
-395,13
+400,7
@@
int autofs4_fill_super(struct super_block *s, void *data, int silent)
goto fail_fput;
sbi->pipe = pipe;
sbi->pipefd = pipefd;
goto fail_fput;
sbi->pipe = pipe;
sbi->pipefd = pipefd;
-
- /*
- * Take a reference to the root dentry so we get a chance to
- * clean up the dentry tree on umount.
- * See autofs4_force_release.
- */
- sbi->root = dget(root);
+ sbi->catatonic = 0;
/*
* Success! Install the root dentry now to indicate completion.
/*
* Success! Install the root dentry now to indicate completion.
@@
-426,6
+425,8
@@
fail_ino:
kfree(ino);
fail_free:
kfree(sbi);
kfree(ino);
fail_free:
kfree(sbi);
+ s->s_fs_info = NULL;
+ kill_anon_super(s);
fail_unlock:
return -EINVAL;
}
fail_unlock:
return -EINVAL;
}
@@
-447,7
+448,6
@@
struct inode *autofs4_get_inode(struct super_block *sb,
inode->i_uid = 0;
inode->i_gid = 0;
}
inode->i_uid = 0;
inode->i_gid = 0;
}
- inode->i_blksize = PAGE_CACHE_SIZE;
inode->i_blocks = 0;
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
inode->i_blocks = 0;
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;