summaryrefslogtreecommitdiff
path: root/fs/orangefs/orangefs-debugfs.c
diff options
context:
space:
mode:
authorMike Marshall <hubcap@omnibond.com>2016-03-14 15:30:39 -0400
committerMike Marshall <hubcap@omnibond.com>2016-03-14 15:48:28 -0400
commit2180c52cc72993b3b097573aaa550f273f795c8a (patch)
treea68459be5a0284947331fd86855a6b858730e1a9 /fs/orangefs/orangefs-debugfs.c
parenta7d3e78ab53ff479fee3ad5a674a74c54c337b3b (diff)
Orangefs: fix sloppy cleanups of debugfs and sysfs init failures.
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Diffstat (limited to 'fs/orangefs/orangefs-debugfs.c')
-rw-r--r--fs/orangefs/orangefs-debugfs.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/fs/orangefs/orangefs-debugfs.c b/fs/orangefs/orangefs-debugfs.c
index 9eb7972ae10d..19670b8b4053 100644
--- a/fs/orangefs/orangefs-debugfs.c
+++ b/fs/orangefs/orangefs-debugfs.c
@@ -101,30 +101,33 @@ 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)
{
- debugfs_remove_recursive(debug_dir);
+ if (debug_dir)
+ debugfs_remove_recursive(debug_dir);
}
/* open ORANGEFS_KMOD_DEBUG_HELP_FILE */
@@ -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;