Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
2180c52c
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
2180c52c
编写于
3月 14, 2016
作者:
M
Mike Marshall
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Orangefs: fix sloppy cleanups of debugfs and sysfs init failures.
Signed-off-by:
N
Mike Marshall
<
hubcap@omnibond.com
>
上级
a7d3e78a
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
76 addition
and
62 deletion
+76
-62
fs/orangefs/orangefs-debugfs.c
fs/orangefs/orangefs-debugfs.c
+9
-11
fs/orangefs/orangefs-mod.c
fs/orangefs/orangefs-mod.c
+23
-6
fs/orangefs/orangefs-sysfs.c
fs/orangefs/orangefs-sysfs.c
+44
-45
未找到文件。
fs/orangefs/orangefs-debugfs.c
浏览文件 @
2180c52c
...
...
@@ -101,29 +101,32 @@ int orangefs_debugfs_init(void)
int
rc
=
-
ENOMEM
;
debug_dir
=
debugfs_create_dir
(
"orangefs"
,
NULL
);
if
(
!
debug_dir
)
if
(
!
debug_dir
)
{
pr_info
(
"%s: debugfs_create_dir failed.
\n
"
,
__func__
);
goto
out
;
}
help_file_dentry
=
debugfs_create_file
(
ORANGEFS_KMOD_DEBUG_HELP_FILE
,
0444
,
debug_dir
,
debug_help_string
,
&
debug_help_fops
);
if
(
!
help_file_dentry
)
if
(
!
help_file_dentry
)
{
pr_info
(
"%s: debugfs_create_file failed.
\n
"
,
__func__
);
goto
out
;
}
orangefs_debug_disabled
=
0
;
rc
=
0
;
out:
if
(
rc
)
orangefs_debugfs_cleanup
();
return
rc
;
}
void
orangefs_debugfs_cleanup
(
void
)
{
if
(
debug_dir
)
debugfs_remove_recursive
(
debug_dir
);
}
...
...
@@ -198,7 +201,6 @@ static int help_show(struct seq_file *m, void *v)
*/
int
orangefs_kernel_debug_init
(
void
)
{
int
rc
=
-
ENOMEM
;
struct
dentry
*
ret
;
char
*
k_buffer
=
NULL
;
...
...
@@ -232,8 +234,6 @@ int orangefs_kernel_debug_init(void)
rc
=
0
;
out:
if
(
rc
)
orangefs_debugfs_cleanup
();
gossip_debug
(
GOSSIP_DEBUGFS_DEBUG
,
"%s: rc:%d:
\n
"
,
__func__
,
rc
);
return
rc
;
...
...
@@ -268,7 +268,7 @@ int orangefs_client_debug_init(void)
c_buffer
,
&
kernel_debug_fops
);
if
(
!
client_debug_dentry
)
{
pr_info
(
"%s: failed to create %s.
\n
"
,
pr_info
(
"%s: failed to create
updated
%s.
\n
"
,
__func__
,
ORANGEFS_CLIENT_DEBUG_FILE
);
goto
out
;
...
...
@@ -277,8 +277,6 @@ int orangefs_client_debug_init(void)
rc
=
0
;
out:
if
(
rc
)
orangefs_debugfs_cleanup
();
gossip_debug
(
GOSSIP_DEBUGFS_DEBUG
,
"%s: rc:%d:
\n
"
,
__func__
,
rc
);
return
rc
;
...
...
fs/orangefs/orangefs-mod.c
浏览文件 @
2180c52c
...
...
@@ -185,22 +185,39 @@ static int __init orangefs_init(void)
*/
ret
=
orangefs_prepare_debugfs_help_string
(
1
);
if
(
ret
)
goto
out
;
goto
prepare_helpstring_failed
;
ret
=
orangefs_debugfs_init
();
if
(
ret
)
goto
debugfs_init_failed
;
orangefs_debugfs_init
();
orangefs_kernel_debug_init
();
orangefs_sysfs_init
();
ret
=
orangefs_kernel_debug_init
();
if
(
ret
)
goto
kernel_debug_init_failed
;
ret
=
orangefs_sysfs_init
();
if
(
ret
)
goto
sysfs_init_failed
;
ret
=
register_filesystem
(
&
orangefs_fs_type
);
if
(
ret
==
0
)
{
pr_info
(
"orangefs: module version %s loaded
\n
"
,
ORANGEFS_VERSION
);
return
0
;
ret
=
0
;
goto
out
;
}
orangefs_debugfs_cleanup
();
orangefs_sysfs_exit
();
fsid_key_table_finalize
();
sysfs_init_failed:
kernel_debug_init_failed:
debugfs_init_failed:
orangefs_debugfs_cleanup
();
prepare_helpstring_failed:
cleanup_progress_table:
kfree
(
htable_ops_in_progress
);
...
...
fs/orangefs/orangefs-sysfs.c
浏览文件 @
2180c52c
...
...
@@ -1611,27 +1611,22 @@ static struct stats_orangefs_obj *stats_orangefs_obj;
int
orangefs_sysfs_init
(
void
)
{
int
rc
;
int
rc
=
-
EINVAL
;
gossip_debug
(
GOSSIP_SYSFS_DEBUG
,
"orangefs_sysfs_init: start
\n
"
);
/* create /sys/fs/orangefs. */
orangefs_obj
=
kzalloc
(
sizeof
(
*
orangefs_obj
),
GFP_KERNEL
);
if
(
!
orangefs_obj
)
{
rc
=
-
EINVAL
;
if
(
!
orangefs_obj
)
goto
out
;
}
rc
=
kobject_init_and_add
(
&
orangefs_obj
->
kobj
,
&
orangefs_ktype
,
fs_kobj
,
ORANGEFS_KOBJ_ID
);
if
(
rc
)
{
kobject_put
(
&
orangefs_obj
->
kobj
);
rc
=
-
EINVAL
;
goto
out
;
}
if
(
rc
)
goto
ofs_obj_bail
;
kobject_uevent
(
&
orangefs_obj
->
kobj
,
KOBJ_ADD
);
...
...
@@ -1639,7 +1634,7 @@ int orangefs_sysfs_init(void)
acache_orangefs_obj
=
kzalloc
(
sizeof
(
*
acache_orangefs_obj
),
GFP_KERNEL
);
if
(
!
acache_orangefs_obj
)
{
rc
=
-
EINVAL
;
goto
o
ut
;
goto
o
fs_obj_bail
;
}
rc
=
kobject_init_and_add
(
&
acache_orangefs_obj
->
kobj
,
...
...
@@ -1647,11 +1642,8 @@ int orangefs_sysfs_init(void)
&
orangefs_obj
->
kobj
,
ACACHE_KOBJ_ID
);
if
(
rc
)
{
kobject_put
(
&
acache_orangefs_obj
->
kobj
);
rc
=
-
EINVAL
;
goto
out
;
}
if
(
rc
)
goto
acache_obj_bail
;
kobject_uevent
(
&
acache_orangefs_obj
->
kobj
,
KOBJ_ADD
);
...
...
@@ -1660,18 +1652,15 @@ int orangefs_sysfs_init(void)
kzalloc
(
sizeof
(
*
capcache_orangefs_obj
),
GFP_KERNEL
);
if
(
!
capcache_orangefs_obj
)
{
rc
=
-
EINVAL
;
goto
out
;
goto
acache_obj_bail
;
}
rc
=
kobject_init_and_add
(
&
capcache_orangefs_obj
->
kobj
,
&
capcache_orangefs_ktype
,
&
orangefs_obj
->
kobj
,
CAPCACHE_KOBJ_ID
);
if
(
rc
)
{
kobject_put
(
&
capcache_orangefs_obj
->
kobj
);
rc
=
-
EINVAL
;
goto
out
;
}
if
(
rc
)
goto
capcache_obj_bail
;
kobject_uevent
(
&
capcache_orangefs_obj
->
kobj
,
KOBJ_ADD
);
...
...
@@ -1680,18 +1669,15 @@ int orangefs_sysfs_init(void)
kzalloc
(
sizeof
(
*
ccache_orangefs_obj
),
GFP_KERNEL
);
if
(
!
ccache_orangefs_obj
)
{
rc
=
-
EINVAL
;
goto
out
;
goto
capcache_obj_bail
;
}
rc
=
kobject_init_and_add
(
&
ccache_orangefs_obj
->
kobj
,
&
ccache_orangefs_ktype
,
&
orangefs_obj
->
kobj
,
CCACHE_KOBJ_ID
);
if
(
rc
)
{
kobject_put
(
&
ccache_orangefs_obj
->
kobj
);
rc
=
-
EINVAL
;
goto
out
;
}
if
(
rc
)
goto
ccache_obj_bail
;
kobject_uevent
(
&
ccache_orangefs_obj
->
kobj
,
KOBJ_ADD
);
...
...
@@ -1699,7 +1685,7 @@ int orangefs_sysfs_init(void)
ncache_orangefs_obj
=
kzalloc
(
sizeof
(
*
ncache_orangefs_obj
),
GFP_KERNEL
);
if
(
!
ncache_orangefs_obj
)
{
rc
=
-
EINVAL
;
goto
out
;
goto
ccache_obj_bail
;
}
rc
=
kobject_init_and_add
(
&
ncache_orangefs_obj
->
kobj
,
...
...
@@ -1707,11 +1693,8 @@ int orangefs_sysfs_init(void)
&
orangefs_obj
->
kobj
,
NCACHE_KOBJ_ID
);
if
(
rc
)
{
kobject_put
(
&
ncache_orangefs_obj
->
kobj
);
rc
=
-
EINVAL
;
goto
out
;
}
if
(
rc
)
goto
ncache_obj_bail
;
kobject_uevent
(
&
ncache_orangefs_obj
->
kobj
,
KOBJ_ADD
);
...
...
@@ -1719,7 +1702,7 @@ int orangefs_sysfs_init(void)
pc_orangefs_obj
=
kzalloc
(
sizeof
(
*
pc_orangefs_obj
),
GFP_KERNEL
);
if
(
!
pc_orangefs_obj
)
{
rc
=
-
EINVAL
;
goto
out
;
goto
ncache_obj_bail
;
}
rc
=
kobject_init_and_add
(
&
pc_orangefs_obj
->
kobj
,
...
...
@@ -1727,11 +1710,8 @@ int orangefs_sysfs_init(void)
&
orangefs_obj
->
kobj
,
"perf_counters"
);
if
(
rc
)
{
kobject_put
(
&
pc_orangefs_obj
->
kobj
);
rc
=
-
EINVAL
;
goto
out
;
}
if
(
rc
)
goto
pc_obj_bail
;
kobject_uevent
(
&
pc_orangefs_obj
->
kobj
,
KOBJ_ADD
);
...
...
@@ -1739,7 +1719,7 @@ int orangefs_sysfs_init(void)
stats_orangefs_obj
=
kzalloc
(
sizeof
(
*
stats_orangefs_obj
),
GFP_KERNEL
);
if
(
!
stats_orangefs_obj
)
{
rc
=
-
EINVAL
;
goto
out
;
goto
pc_obj_bail
;
}
rc
=
kobject_init_and_add
(
&
stats_orangefs_obj
->
kobj
,
...
...
@@ -1747,13 +1727,32 @@ int orangefs_sysfs_init(void)
&
orangefs_obj
->
kobj
,
STATS_KOBJ_ID
);
if
(
rc
)
{
kobject_put
(
&
stats_orangefs_obj
->
kobj
);
rc
=
-
EINVAL
;
goto
out
;
}
if
(
rc
)
goto
stats_obj_bail
;
kobject_uevent
(
&
stats_orangefs_obj
->
kobj
,
KOBJ_ADD
);
goto
out
;
stats_obj_bail:
kobject_put
(
&
stats_orangefs_obj
->
kobj
);
pc_obj_bail:
kobject_put
(
&
pc_orangefs_obj
->
kobj
);
ncache_obj_bail:
kobject_put
(
&
ncache_orangefs_obj
->
kobj
);
ccache_obj_bail:
kobject_put
(
&
ccache_orangefs_obj
->
kobj
);
capcache_obj_bail:
kobject_put
(
&
capcache_orangefs_obj
->
kobj
);
acache_obj_bail:
kobject_put
(
&
acache_orangefs_obj
->
kobj
);
ofs_obj_bail:
kobject_put
(
&
orangefs_obj
->
kobj
);
out:
return
rc
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录