diff options
author | Jan Kara <jack@suse.cz> | 2014-12-10 18:41:56 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-10 20:41:03 -0500 |
commit | dc17158060fb57f49c310a7def12fdaeddf35b19 (patch) | |
tree | 1b1bdae0c2a15a4fe834e9d38c85adf6e10e8e6e /fs/ocfs2 | |
parent | 86b9c6f3f891019b26f8e5bb11a6faa96bba54a8 (diff) |
ocfs2: fix error handling when creating debugfs root in ocfs2_init()
Error handling if creation of root of debugfs in ocfs2_init() fails is
broken. Although error code is set we fail to exit ocfs2_init() with
error and thus initialization ends with success. Later when mounting a
filesystem, ocfs2 debugfs entries end up being created in the root of
debugfs filesystem which is confusing.
Fix the error handling to bail out.
Coverity id: 1227009.
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Joseph Qi <joseph.qi@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r-- | fs/ocfs2/super.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 93c85bc745e1..8e3ac25efb9f 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -1622,8 +1622,9 @@ static int __init ocfs2_init(void) | |||
1622 | 1622 | ||
1623 | ocfs2_debugfs_root = debugfs_create_dir("ocfs2", NULL); | 1623 | ocfs2_debugfs_root = debugfs_create_dir("ocfs2", NULL); |
1624 | if (!ocfs2_debugfs_root) { | 1624 | if (!ocfs2_debugfs_root) { |
1625 | status = -EFAULT; | 1625 | status = -ENOMEM; |
1626 | mlog(ML_ERROR, "Unable to create ocfs2 debugfs root.\n"); | 1626 | mlog(ML_ERROR, "Unable to create ocfs2 debugfs root.\n"); |
1627 | goto out4; | ||
1627 | } | 1628 | } |
1628 | 1629 | ||
1629 | ocfs2_set_locking_protocol(); | 1630 | ocfs2_set_locking_protocol(); |