f2fs: convert S_IRUGO to 0444
authorYangtao Li <frank.li@vivo.com>
Sat, 14 Aug 2021 10:37:01 +0000 (18:37 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 17 Aug 2021 18:59:05 +0000 (11:59 -0700)
To fix:
WARNING: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/debug.c
fs/f2fs/sysfs.c

index d8c09346545dd7f68974cf60ebf735bdb8000d62..8c50518475a99a32e7ac9c4f724a982c745ad46b 100644 (file)
@@ -642,7 +642,7 @@ void __init f2fs_create_root_stats(void)
 #ifdef CONFIG_DEBUG_FS
        f2fs_debugfs_root = debugfs_create_dir("f2fs", NULL);
 
-       debugfs_create_file("status", S_IRUGO, f2fs_debugfs_root, NULL,
+       debugfs_create_file("status", 0444, f2fs_debugfs_root, NULL,
                            &stat_fops);
 #endif
 }
index 0954761341d7fba0b47bf660cdddcbc001c14215..36d7e40bf12eae647e2a47849cf4ab545b1d1fd1 100644 (file)
@@ -1253,13 +1253,13 @@ int f2fs_register_sysfs(struct f2fs_sb_info *sbi)
                sbi->s_proc = proc_mkdir(sb->s_id, f2fs_proc_root);
 
        if (sbi->s_proc) {
-               proc_create_single_data("segment_info", S_IRUGO, sbi->s_proc,
+               proc_create_single_data("segment_info", 0444, sbi->s_proc,
                                segment_info_seq_show, sb);
-               proc_create_single_data("segment_bits", S_IRUGO, sbi->s_proc,
+               proc_create_single_data("segment_bits", 0444, sbi->s_proc,
                                segment_bits_seq_show, sb);
-               proc_create_single_data("iostat_info", S_IRUGO, sbi->s_proc,
+               proc_create_single_data("iostat_info", 0444, sbi->s_proc,
                                iostat_info_seq_show, sb);
-               proc_create_single_data("victim_bits", S_IRUGO, sbi->s_proc,
+               proc_create_single_data("victim_bits", 0444, sbi->s_proc,
                                victim_bits_seq_show, sb);
        }
        return 0;