diff options
author | Chao Yu <chao2.yu@samsung.com> | 2015-10-28 21:13:04 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-12-04 14:52:33 -0500 |
commit | 787c7b8cb3c5196f77e4682e0b1c71375e74822c (patch) | |
tree | fc4d95e9b7f37c0095fb9adb4337bcb89a1da1da /fs/f2fs/debug.c | |
parent | fb39cbda147082a2e7dc4e2b5f3298448295e3c4 (diff) |
f2fs: report error of f2fs_create_root_stats
f2fs_create_root_stats can fail due to no memory, report it to user.
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/debug.c')
-rw-r--r-- | fs/f2fs/debug.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/f2fs/debug.c b/fs/f2fs/debug.c index 478e5d54154f..b0966f3b1c9a 100644 --- a/fs/f2fs/debug.c +++ b/fs/f2fs/debug.c | |||
@@ -406,20 +406,23 @@ void f2fs_destroy_stats(struct f2fs_sb_info *sbi) | |||
406 | kfree(si); | 406 | kfree(si); |
407 | } | 407 | } |
408 | 408 | ||
409 | void __init f2fs_create_root_stats(void) | 409 | int __init f2fs_create_root_stats(void) |
410 | { | 410 | { |
411 | struct dentry *file; | 411 | struct dentry *file; |
412 | 412 | ||
413 | f2fs_debugfs_root = debugfs_create_dir("f2fs", NULL); | 413 | f2fs_debugfs_root = debugfs_create_dir("f2fs", NULL); |
414 | if (!f2fs_debugfs_root) | 414 | if (!f2fs_debugfs_root) |
415 | return; | 415 | return -ENOMEM; |
416 | 416 | ||
417 | file = debugfs_create_file("status", S_IRUGO, f2fs_debugfs_root, | 417 | file = debugfs_create_file("status", S_IRUGO, f2fs_debugfs_root, |
418 | NULL, &stat_fops); | 418 | NULL, &stat_fops); |
419 | if (!file) { | 419 | if (!file) { |
420 | debugfs_remove(f2fs_debugfs_root); | 420 | debugfs_remove(f2fs_debugfs_root); |
421 | f2fs_debugfs_root = NULL; | 421 | f2fs_debugfs_root = NULL; |
422 | return -ENOMEM; | ||
422 | } | 423 | } |
424 | |||
425 | return 0; | ||
423 | } | 426 | } |
424 | 427 | ||
425 | void f2fs_destroy_root_stats(void) | 428 | void f2fs_destroy_root_stats(void) |