|
@@ -225,6 +225,7 @@ static int parse_fsopt_token(char *c, void *private)
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
break;
|
|
break;
|
|
case Opt_mds_namespace:
|
|
case Opt_mds_namespace:
|
|
|
|
+ kfree(fsopt->mds_namespace);
|
|
fsopt->mds_namespace = kstrndup(argstr[0].from,
|
|
fsopt->mds_namespace = kstrndup(argstr[0].from,
|
|
argstr[0].to-argstr[0].from,
|
|
argstr[0].to-argstr[0].from,
|
|
GFP_KERNEL);
|
|
GFP_KERNEL);
|
|
@@ -232,6 +233,7 @@ static int parse_fsopt_token(char *c, void *private)
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
break;
|
|
break;
|
|
case Opt_fscache_uniq:
|
|
case Opt_fscache_uniq:
|
|
|
|
+ kfree(fsopt->fscache_uniq);
|
|
fsopt->fscache_uniq = kstrndup(argstr[0].from,
|
|
fsopt->fscache_uniq = kstrndup(argstr[0].from,
|
|
argstr[0].to-argstr[0].from,
|
|
argstr[0].to-argstr[0].from,
|
|
GFP_KERNEL);
|
|
GFP_KERNEL);
|
|
@@ -711,14 +713,17 @@ static int __init init_caches(void)
|
|
goto bad_dentry;
|
|
goto bad_dentry;
|
|
|
|
|
|
ceph_file_cachep = KMEM_CACHE(ceph_file_info, SLAB_MEM_SPREAD);
|
|
ceph_file_cachep = KMEM_CACHE(ceph_file_info, SLAB_MEM_SPREAD);
|
|
-
|
|
|
|
if (!ceph_file_cachep)
|
|
if (!ceph_file_cachep)
|
|
goto bad_file;
|
|
goto bad_file;
|
|
|
|
|
|
- if ((error = ceph_fscache_register()))
|
|
|
|
- goto bad_file;
|
|
|
|
|
|
+ error = ceph_fscache_register();
|
|
|
|
+ if (error)
|
|
|
|
+ goto bad_fscache;
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
|
|
+
|
|
|
|
+bad_fscache:
|
|
|
|
+ kmem_cache_destroy(ceph_file_cachep);
|
|
bad_file:
|
|
bad_file:
|
|
kmem_cache_destroy(ceph_dentry_cachep);
|
|
kmem_cache_destroy(ceph_dentry_cachep);
|
|
bad_dentry:
|
|
bad_dentry:
|
|
@@ -836,7 +841,6 @@ static struct dentry *ceph_real_mount(struct ceph_fs_client *fsc)
|
|
int err;
|
|
int err;
|
|
unsigned long started = jiffies; /* note the start time */
|
|
unsigned long started = jiffies; /* note the start time */
|
|
struct dentry *root;
|
|
struct dentry *root;
|
|
- int first = 0; /* first vfsmount for this super_block */
|
|
|
|
|
|
|
|
dout("mount start %p\n", fsc);
|
|
dout("mount start %p\n", fsc);
|
|
mutex_lock(&fsc->client->mount_mutex);
|
|
mutex_lock(&fsc->client->mount_mutex);
|
|
@@ -861,17 +865,17 @@ static struct dentry *ceph_real_mount(struct ceph_fs_client *fsc)
|
|
path = fsc->mount_options->server_path + 1;
|
|
path = fsc->mount_options->server_path + 1;
|
|
dout("mount opening path %s\n", path);
|
|
dout("mount opening path %s\n", path);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ err = ceph_fs_debugfs_init(fsc);
|
|
|
|
+ if (err < 0)
|
|
|
|
+ goto out;
|
|
|
|
+
|
|
root = open_root_dentry(fsc, path, started);
|
|
root = open_root_dentry(fsc, path, started);
|
|
if (IS_ERR(root)) {
|
|
if (IS_ERR(root)) {
|
|
err = PTR_ERR(root);
|
|
err = PTR_ERR(root);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
fsc->sb->s_root = dget(root);
|
|
fsc->sb->s_root = dget(root);
|
|
- first = 1;
|
|
|
|
-
|
|
|
|
- err = ceph_fs_debugfs_init(fsc);
|
|
|
|
- if (err < 0)
|
|
|
|
- goto fail;
|
|
|
|
} else {
|
|
} else {
|
|
root = dget(fsc->sb->s_root);
|
|
root = dget(fsc->sb->s_root);
|
|
}
|
|
}
|
|
@@ -881,11 +885,6 @@ static struct dentry *ceph_real_mount(struct ceph_fs_client *fsc)
|
|
mutex_unlock(&fsc->client->mount_mutex);
|
|
mutex_unlock(&fsc->client->mount_mutex);
|
|
return root;
|
|
return root;
|
|
|
|
|
|
-fail:
|
|
|
|
- if (first) {
|
|
|
|
- dput(fsc->sb->s_root);
|
|
|
|
- fsc->sb->s_root = NULL;
|
|
|
|
- }
|
|
|
|
out:
|
|
out:
|
|
mutex_unlock(&fsc->client->mount_mutex);
|
|
mutex_unlock(&fsc->client->mount_mutex);
|
|
return ERR_PTR(err);
|
|
return ERR_PTR(err);
|