Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1257869 > unrolled thread

[PATCH 1/2] f2fs: report error of f2fs_create_root_stats

Started byChao Yu <chao2.yu@samsung.com>
First post2015-10-28 11:00 +0100
Last post2015-10-29 02:20 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/2] f2fs: report error of f2fs_create_root_stats Chao Yu <chao2.yu@samsung.com> - 2015-10-28 11:00 +0100
    Re: [PATCH 1/2] f2fs: report error of f2fs_create_root_stats kbuild test robot <lkp@intel.com> - 2015-10-28 11:40 +0100
      RE: [PATCH 1/2] f2fs: report error of f2fs_create_root_stats Chao Yu <chao2.yu@samsung.com> - 2015-10-29 02:20 +0100

#1257869 — [PATCH 1/2] f2fs: report error of f2fs_create_root_stats

FromChao Yu <chao2.yu@samsung.com>
Date2015-10-28 11:00 +0100
Subject[PATCH 1/2] f2fs: report error of f2fs_create_root_stats
Message-ID<qovGq-VU-5@gated-at.bofh.it>
f2fs_create_root_stats can fail due to no memory, report it to user.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
---
 fs/f2fs/debug.c | 7 +++++--
 fs/f2fs/f2fs.h  | 4 ++--
 fs/f2fs/super.c | 6 +++++-
 3 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/fs/f2fs/debug.c b/fs/f2fs/debug.c
index 478e5d5..b0966f3 100644
--- a/fs/f2fs/debug.c
+++ b/fs/f2fs/debug.c
@@ -406,20 +406,23 @@ void f2fs_destroy_stats(struct f2fs_sb_info *sbi)
 	kfree(si);
 }
 
-void __init f2fs_create_root_stats(void)
+int __init f2fs_create_root_stats(void)
 {
 	struct dentry *file;
 
 	f2fs_debugfs_root = debugfs_create_dir("f2fs", NULL);
 	if (!f2fs_debugfs_root)
-		return;
+		return -ENOMEM;
 
 	file = debugfs_create_file("status", S_IRUGO, f2fs_debugfs_root,
 			NULL, &stat_fops);
 	if (!file) {
 		debugfs_remove(f2fs_debugfs_root);
 		f2fs_debugfs_root = NULL;
+		return -ENOMEM;
 	}
+
+	return 0;
 }
 
 void f2fs_destroy_root_stats(void)
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index d630a4d..5f21f7c 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -1989,7 +1989,7 @@ static inline struct f2fs_stat_info *F2FS_STAT(struct f2fs_sb_info *sbi)
 
 int f2fs_build_stats(struct f2fs_sb_info *);
 void f2fs_destroy_stats(struct f2fs_sb_info *);
-void __init f2fs_create_root_stats(void);
+int __init f2fs_create_root_stats(void);
 void f2fs_destroy_root_stats(void);
 #else
 #define stat_inc_cp_count(si)
@@ -2017,7 +2017,7 @@ void f2fs_destroy_root_stats(void);
 
 static inline int f2fs_build_stats(struct f2fs_sb_info *sbi) { return 0; }
 static inline void f2fs_destroy_stats(struct f2fs_sb_info *sbi) { }
-static inline void __init f2fs_create_root_stats(void) { }
+static inline int __init f2fs_create_root_stats(void) { }
 static inline void f2fs_destroy_root_stats(void) { }
 #endif
 
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 13c821f..9d0ea11 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -1479,10 +1479,14 @@ static int __init init_f2fs_fs(void)
 	err = register_filesystem(&f2fs_fs_type);
 	if (err)
 		goto free_shrinker;
-	f2fs_create_root_stats();
+	err = f2fs_create_root_stats();
+	if (err)
+		goto free_filesystem;
 	f2fs_proc_root = proc_mkdir("fs/f2fs", NULL);
 	return 0;
 
+free_filesystem:
+	unregister_filesystem(&f2fs_fs_type);
 free_shrinker:
 	unregister_shrinker(&f2fs_shrinker_info);
 free_crypto:
-- 
2.6.1


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1257889

Fromkbuild test robot <lkp@intel.com>
Date2015-10-28 11:40 +0100
Message-ID<qowj7-1pQ-1@gated-at.bofh.it>
In reply to#1257869

[Multipart message — attachments visible in raw view] — view raw

Hi Chao,

[auto build test WARNING on f2fs/dev -- if it's inappropriate base, please suggest rules for selecting the more suitable base]

url:    https://github.com/0day-ci/linux/commits/Chao-Yu/f2fs-report-error-of-f2fs_create_root_stats/20151028-175937
config: x86_64-randconfig-x015-201543 (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   In file included from fs/f2fs/dir.c:13:0:
   fs/f2fs/f2fs.h: In function 'f2fs_create_root_stats':
>> fs/f2fs/f2fs.h:2018:1: warning: no return statement in function returning non-void [-Wreturn-type]
    static inline int __init f2fs_create_root_stats(void) { }
    ^
--
   In file included from fs/f2fs/namei.c:19:0:
   fs/f2fs/f2fs.h: In function 'f2fs_create_root_stats':
>> fs/f2fs/f2fs.h:2018:1: warning: no return statement in function returning non-void [-Wreturn-type]
    static inline int __init f2fs_create_root_stats(void) { }
    ^
   fs/f2fs/namei.c: In function 'f2fs_symlink':
   fs/f2fs/namei.c:414:59: warning: 'p_len' may be used uninitialized in this function [-Wmaybe-uninitialized]
      filemap_write_and_wait_range(inode->i_mapping, 0, p_len - 1);
                                                              ^
--
   In file included from fs/f2fs/node.c:19:0:
   fs/f2fs/f2fs.h: In function 'f2fs_create_root_stats':
>> fs/f2fs/f2fs.h:2018:1: warning: no return statement in function returning non-void [-Wreturn-type]
    static inline int __init f2fs_create_root_stats(void) { }
    ^
   fs/f2fs/node.c: In function 'flush_nat_entries':
   fs/f2fs/node.c:1920:11: warning: 'nat_blk' may be used uninitialized in this function [-Wmaybe-uninitialized]
       raw_ne = &nat_blk->entries[nid - start_nid];
              ^
   fs/f2fs/node.c:1883:25: note: 'nat_blk' was declared here
     struct f2fs_nat_block *nat_blk;
                            ^

vim +2018 fs/f2fs/f2fs.h

  2002	#define stat_inc_inline_xattr(inode)
  2003	#define stat_dec_inline_xattr(inode)
  2004	#define stat_inc_inline_inode(inode)
  2005	#define stat_dec_inline_inode(inode)
  2006	#define stat_inc_inline_dir(inode)
  2007	#define stat_dec_inline_dir(inode)
  2008	#define stat_inc_seg_type(sbi, curseg)
  2009	#define stat_inc_block_count(sbi, curseg)
  2010	#define stat_inc_inplace_blocks(sbi)
  2011	#define stat_inc_seg_count(sbi, type, gc_type)
  2012	#define stat_inc_tot_blk_count(si, blks)
  2013	#define stat_inc_data_blk_count(sbi, blks, gc_type)
  2014	#define stat_inc_node_blk_count(sbi, blks, gc_type)
  2015	
  2016	static inline int f2fs_build_stats(struct f2fs_sb_info *sbi) { return 0; }
  2017	static inline void f2fs_destroy_stats(struct f2fs_sb_info *sbi) { }
> 2018	static inline int __init f2fs_create_root_stats(void) { }
  2019	static inline void f2fs_destroy_root_stats(void) { }
  2020	#endif
  2021	
  2022	extern const struct file_operations f2fs_dir_operations;
  2023	extern const struct file_operations f2fs_file_operations;
  2024	extern const struct inode_operations f2fs_file_inode_operations;
  2025	extern const struct address_space_operations f2fs_dblock_aops;
  2026	extern const struct address_space_operations f2fs_node_aops;

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[toc] | [prev] | [next] | [standalone]


#1258510

FromChao Yu <chao2.yu@samsung.com>
Date2015-10-29 02:20 +0100
Message-ID<qoK2K-1XL-9@gated-at.bofh.it>
In reply to#1257889
Hi,

Thanks for reporting this, I will fix it. :)

Regards,

> -----Original Message-----
> From: kbuild test robot [mailto:lkp@intel.com]
> Sent: Wednesday, October 28, 2015 6:30 PM
> To: Chao Yu
> Cc: kbuild-all@01.org; Jaegeuk Kim; linux-f2fs-devel@lists.sourceforge.net;
> linux-kernel@vger.kernel.org
> Subject: Re: [PATCH 1/2] f2fs: report error of f2fs_create_root_stats
> 
> Hi Chao,
> 
> [auto build test WARNING on f2fs/dev -- if it's inappropriate base, please suggest rules for
> selecting the more suitable base]
> 
> url:
> https://github.com/0day-ci/linux/commits/Chao-Yu/f2fs-report-error-of-f2fs_create_root_sta
> ts/20151028-175937
> config: x86_64-randconfig-x015-201543 (attached as .config)
> reproduce:
>         # save the attached .config to linux build tree
>         make ARCH=x86_64
> 
> All warnings (new ones prefixed by >>):
> 
>    In file included from fs/f2fs/dir.c:13:0:
>    fs/f2fs/f2fs.h: In function 'f2fs_create_root_stats':
> >> fs/f2fs/f2fs.h:2018:1: warning: no return statement in function returning non-void
> [-Wreturn-type]
>     static inline int __init f2fs_create_root_stats(void) { }
>     ^
> --
>    In file included from fs/f2fs/namei.c:19:0:
>    fs/f2fs/f2fs.h: In function 'f2fs_create_root_stats':
> >> fs/f2fs/f2fs.h:2018:1: warning: no return statement in function returning non-void
> [-Wreturn-type]
>     static inline int __init f2fs_create_root_stats(void) { }
>     ^
>    fs/f2fs/namei.c: In function 'f2fs_symlink':
>    fs/f2fs/namei.c:414:59: warning: 'p_len' may be used uninitialized in this function
> [-Wmaybe-uninitialized]
>       filemap_write_and_wait_range(inode->i_mapping, 0, p_len - 1);
>                                                               ^
> --
>    In file included from fs/f2fs/node.c:19:0:
>    fs/f2fs/f2fs.h: In function 'f2fs_create_root_stats':
> >> fs/f2fs/f2fs.h:2018:1: warning: no return statement in function returning non-void
> [-Wreturn-type]
>     static inline int __init f2fs_create_root_stats(void) { }
>     ^
>    fs/f2fs/node.c: In function 'flush_nat_entries':
>    fs/f2fs/node.c:1920:11: warning: 'nat_blk' may be used uninitialized in this function
> [-Wmaybe-uninitialized]
>        raw_ne = &nat_blk->entries[nid - start_nid];
>               ^
>    fs/f2fs/node.c:1883:25: note: 'nat_blk' was declared here
>      struct f2fs_nat_block *nat_blk;
>                             ^
> 
> vim +2018 fs/f2fs/f2fs.h
> 
>   2002	#define stat_inc_inline_xattr(inode)
>   2003	#define stat_dec_inline_xattr(inode)
>   2004	#define stat_inc_inline_inode(inode)
>   2005	#define stat_dec_inline_inode(inode)
>   2006	#define stat_inc_inline_dir(inode)
>   2007	#define stat_dec_inline_dir(inode)
>   2008	#define stat_inc_seg_type(sbi, curseg)
>   2009	#define stat_inc_block_count(sbi, curseg)
>   2010	#define stat_inc_inplace_blocks(sbi)
>   2011	#define stat_inc_seg_count(sbi, type, gc_type)
>   2012	#define stat_inc_tot_blk_count(si, blks)
>   2013	#define stat_inc_data_blk_count(sbi, blks, gc_type)
>   2014	#define stat_inc_node_blk_count(sbi, blks, gc_type)
>   2015
>   2016	static inline int f2fs_build_stats(struct f2fs_sb_info *sbi) { return 0; }
>   2017	static inline void f2fs_destroy_stats(struct f2fs_sb_info *sbi) { }
> > 2018	static inline int __init f2fs_create_root_stats(void) { }
>   2019	static inline void f2fs_destroy_root_stats(void) { }
>   2020	#endif
>   2021
>   2022	extern const struct file_operations f2fs_dir_operations;
>   2023	extern const struct file_operations f2fs_file_operations;
>   2024	extern const struct inode_operations f2fs_file_inode_operations;
>   2025	extern const struct address_space_operations f2fs_dblock_aops;
>   2026	extern const struct address_space_operations f2fs_node_aops;
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web