diff options
author | 2004-01-26 11:28:44 +0000 | |
---|---|---|
committer | 2004-01-26 11:28:44 +0000 | |
commit | 307242f21bf3ca7a0fb0f30da45b5956f47b0250 (patch) | |
tree | 746fbdb6e416dcba61f905c19be0c33c52de5939 /kernel/inode.c | |
parent | e815c03771bfe19a12f9ff76639b28567942903c (diff) |
fix
Diffstat (limited to 'kernel/inode.c')
-rw-r--r-- | kernel/inode.c | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/kernel/inode.c b/kernel/inode.c index 4a16051..f5c3a97 100644 --- a/kernel/inode.c +++ b/kernel/inode.c @@ -201,38 +201,35 @@ static int fuse_read_super(struct super_block *sb, void *data, int silent) sb->s_export_op = &fuse_export_operations; #endif - root = get_root_inode(sb, d->rootmode); - if(root == NULL) { - printk("fuse_read_super: failed to get root inode\n"); - return -EINVAL; - } - - spin_lock(&fuse_lock); fc = get_conn(d); if(fc == NULL) - goto err; - + return -EINVAL; + spin_lock(&fuse_lock); if(fc->sb != NULL) { printk("fuse_read_super: connection already mounted\n"); - goto err; + spin_unlock(&fuse_lock); + return -EINVAL; } - - SB_FC(sb) = fc; - sb->s_root = d_alloc_root(root); - if(!sb->s_root) - goto err; - fc->sb = sb; fc->flags = d->flags; fc->uid = d->uid; spin_unlock(&fuse_lock); - return 0; + /* fc is needed in fuse_init_file_inode which could be called + from get_root_inode */ + SB_FC(sb) = fc; - err: - spin_unlock(&fuse_lock); - iput(root); - return -EINVAL; + root = get_root_inode(sb, d->rootmode); + if(root == NULL) { + printk("fuse_read_super: failed to get root inode\n"); + return -EINVAL; + } + + sb->s_root = d_alloc_root(root); + if(!sb->s_root) + return -EINVAL; + + return 0; } #ifdef KERNEL_2_6 |