All of lore.kernel.org
 help / color / mirror / Atom feed
* [android-common:android-4.19-stable 1/1] fs/f2fs/inode.c:307:7: warning: format specifies type 'unsigned long' but the argument has type 'blkcnt_t' (aka 'unsigned long long')
@ 2021-07-27  2:22 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-07-27  2:22 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 14838 bytes --]

tree:   https://android.googlesource.com/kernel/common android-4.19-stable
head:   c1fae4b2550e30eff0ee060298e18bf94a82df74
commit: c1fae4b2550e30eff0ee060298e18bf94a82df74 [1/1] UPSTREAM: Merge remote-tracking branch 'aosp/upstream-f2fs-stable-linux-4.19.y' into android-4.19 (v5.7-rc1)
config: arm-randconfig-r005-20210726 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project c658b472f3e61e1818e1909bf02f3d65470018a5)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        git remote add android-common https://android.googlesource.com/kernel/common
        git fetch --no-tags android-common android-4.19-stable
        git checkout c1fae4b2550e30eff0ee060298e18bf94a82df74
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   include/linux/byteorder/generic.h:203:16: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned int') [-Wsign-compare]
           for (i = 0; i < len; i++)
                       ~ ^ ~~~
   In file included from fs/f2fs/inode.c:8:
   In file included from include/linux/fs.h:6:
   In file included from include/linux/wait_bit.h:8:
   In file included from include/linux/wait.h:9:
   In file included from include/linux/spinlock.h:51:
   In file included from include/linux/preempt.h:81:
   In file included from ./arch/arm/include/generated/asm/preempt.h:1:
   In file included from include/asm-generic/preempt.h:5:
   include/linux/thread_info.h:141:29: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned int') [-Wsign-compare]
           if (unlikely(sz >= 0 && sz < bytes)) {
                                   ~~ ^ ~~~~~
   include/linux/compiler.h:77:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   In file included from fs/f2fs/inode.c:8:
   In file included from include/linux/fs.h:8:
   In file included from include/linux/dcache.h:7:
   In file included from include/linux/rculist.h:11:
   In file included from include/linux/rcupdate.h:44:
   In file included from include/linux/cpumask.h:12:
   include/linux/bitmap.h:359:36: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
           return find_first_bit(src, nbits) == nbits;
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~
   include/linux/bitmap.h:367:41: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
           return find_first_zero_bit(src, nbits) == nbits;
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~
   In file included from fs/f2fs/inode.c:8:
   In file included from include/linux/fs.h:237:
   In file included from include/linux/quota.h:40:
   In file included from include/linux/percpu_counter.h:16:
   In file included from include/linux/gfp.h:6:
   include/linux/mmzone.h:1000:44: warning: comparison of integers of different signs: 'int' and 'enum zone_type' [-Wsign-compare]
           if (likely(!nodes && zonelist_zone_idx(z) <= highest_zoneidx))
                                ~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~
   include/linux/compiler.h:76:40: note: expanded from macro 'likely'
   # define likely(x)      __builtin_expect(!!(x), 1)
                                               ^
   In file included from fs/f2fs/inode.c:9:
   In file included from include/linux/f2fs_fs.h:11:
   In file included from include/linux/pagemap.h:8:
   In file included from include/linux/mm.h:26:
   In file included from include/linux/page_ref.h:7:
   include/linux/page-flags.h:163:21: warning: comparison of integers of different signs: 'const unsigned long' and 'long' [-Wsign-compare]
           return page->flags == PAGE_POISON_PATTERN;
                  ~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~
   In file included from fs/f2fs/inode.c:11:
   In file included from include/linux/backing-dev.h:15:
   In file included from include/linux/blkdev.h:21:
   include/linux/bio.h:413:14: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
           if (sectors >= bio_sectors(bio))
               ~~~~~~~ ^  ~~~~~~~~~~~~~~~~
   In file included from fs/f2fs/inode.c:11:
   In file included from include/linux/backing-dev.h:17:
   In file included from include/linux/blk-cgroup.h:17:
   In file included from include/linux/cgroup.h:28:
   include/linux/cgroup-defs.h:475:16: warning: field 'cgrp' with variable sized type 'struct cgroup' not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
           struct cgroup cgrp;
                         ^
   In file included from fs/f2fs/inode.c:14:
   fs/f2fs/f2fs.h:400:15: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
                   return size <= MAX_NAT_JENTRIES(journal);
                          ~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/f2fs/f2fs.h:401:14: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
           return size <= MAX_SIT_JENTRIES(journal);
                  ~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/f2fs/f2fs.h:1634:21: warning: field 'shash' with variable sized type 'struct shash_desc' not@the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
                   struct shash_desc shash;
                                     ^
   In file included from fs/f2fs/inode.c:16:
   fs/f2fs/segment.h:378:16: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
           for (i = 0; i < end - start; i++) {
                       ~ ^ ~~~~~~~~~~~
   fs/f2fs/segment.h:571:33: warning: comparison of integers of different signs: 'unsigned int' and 'int' [-Wsign-compare]
           if (free_sections(sbi) + freed == reserved_sections(sbi) + needed &&
               ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/f2fs/segment.h:574:38: warning: comparison of integers of different signs: 'unsigned int' and 'int' [-Wsign-compare]
           return (free_sections(sbi) + freed) <=
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
   fs/f2fs/segment.h:690:19: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
           } while (cur_pos < sbi->blocks_per_seg);
                    ~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~
   fs/f2fs/segment.h:701:15: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
                                           || segno > TOTAL_SEGS(sbi) - 1)) {
                                           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:77:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   In file included from fs/f2fs/inode.c:16:
   fs/f2fs/segment.h:761:10: warning: comparison of integers of different signs: 'time64_t' (aka 'long long') and 'unsigned long long' [-Wsign-compare]
           if (now >= sit_i->mounted_time)
               ~~~ ^  ~~~~~~~~~~~~~~~~~~~
   fs/f2fs/segment.h:767:27: warning: comparison of integers of different signs: 'unsigned long long' and 'time64_t' (aka 'long long') [-Wsign-compare]
                   if (sit_i->elapsed_time >= diff)
                       ~~~~~~~~~~~~~~~~~~~ ^  ~~~~
   fs/f2fs/segment.h:855:13: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
                   if (i + 1 < dcc->discard_granularity)
                       ~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~
>> fs/f2fs/inode.c:307:7: warning: format specifies type 'unsigned long' but the argument has type 'blkcnt_t' (aka 'unsigned long long') [-Wformat]
                                     SECTOR_TO_BLOCK(inode->i_blocks));
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/f2fs/f2fs.h:2012:39: note: expanded from macro 'f2fs_warn'
           f2fs_printk(sbi, KERN_WARNING fmt, ##__VA_ARGS__)
                                         ~~~    ^~~~~~~~~~~
   fs/f2fs/segment.h:119:2: note: expanded from macro 'SECTOR_TO_BLOCK'
           ((sectors) >> F2FS_LOG_SECTORS_PER_BLOCK)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/f2fs/inode.c:238:24: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
           if (fi->i_extra_isize > F2FS_TOTAL_EXTRA_ATTR_SIZE ||
               ~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/f2fs/inode.c:251:27: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
                   fi->i_inline_xattr_size > MAX_INLINE_XATTR_SIZE)) {
                   ~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~
   23 warnings generated.
   /usr/bin/as: unrecognized option '-EL'
   clang-13: error: assembler command failed with exit code 1 (use -v to see invocation)


vim +307 fs/f2fs/inode.c

   198	
   199	static bool sanity_check_inode(struct inode *inode, struct page *node_page)
   200	{
   201		struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
   202		struct f2fs_inode_info *fi = F2FS_I(inode);
   203		struct f2fs_inode *ri = F2FS_INODE(node_page);
   204		unsigned long long iblocks;
   205	
   206		iblocks = le64_to_cpu(F2FS_INODE(node_page)->i_blocks);
   207		if (!iblocks) {
   208			set_sbi_flag(sbi, SBI_NEED_FSCK);
   209			f2fs_warn(sbi, "%s: corrupted inode i_blocks i_ino=%lx iblocks=%llu, run fsck to fix.",
   210				  __func__, inode->i_ino, iblocks);
   211			return false;
   212		}
   213	
   214		if (ino_of_node(node_page) != nid_of_node(node_page)) {
   215			set_sbi_flag(sbi, SBI_NEED_FSCK);
   216			f2fs_warn(sbi, "%s: corrupted inode footer i_ino=%lx, ino,nid: [%u, %u] run fsck to fix.",
   217				  __func__, inode->i_ino,
   218				  ino_of_node(node_page), nid_of_node(node_page));
   219			return false;
   220		}
   221	
   222		if (f2fs_sb_has_flexible_inline_xattr(sbi)
   223				&& !f2fs_has_extra_attr(inode)) {
   224			set_sbi_flag(sbi, SBI_NEED_FSCK);
   225			f2fs_warn(sbi, "%s: corrupted inode ino=%lx, run fsck to fix.",
   226				  __func__, inode->i_ino);
   227			return false;
   228		}
   229	
   230		if (f2fs_has_extra_attr(inode) &&
   231				!f2fs_sb_has_extra_attr(sbi)) {
   232			set_sbi_flag(sbi, SBI_NEED_FSCK);
   233			f2fs_warn(sbi, "%s: inode (ino=%lx) is with extra_attr, but extra_attr feature is off",
   234				  __func__, inode->i_ino);
   235			return false;
   236		}
   237	
   238		if (fi->i_extra_isize > F2FS_TOTAL_EXTRA_ATTR_SIZE ||
   239				fi->i_extra_isize % sizeof(__le32)) {
   240			set_sbi_flag(sbi, SBI_NEED_FSCK);
   241			f2fs_warn(sbi, "%s: inode (ino=%lx) has corrupted i_extra_isize: %d, max: %zu",
   242				  __func__, inode->i_ino, fi->i_extra_isize,
   243				  F2FS_TOTAL_EXTRA_ATTR_SIZE);
   244			return false;
   245		}
   246	
   247		if (f2fs_has_extra_attr(inode) &&
   248			f2fs_sb_has_flexible_inline_xattr(sbi) &&
   249			f2fs_has_inline_xattr(inode) &&
   250			(!fi->i_inline_xattr_size ||
   251			fi->i_inline_xattr_size > MAX_INLINE_XATTR_SIZE)) {
   252			set_sbi_flag(sbi, SBI_NEED_FSCK);
   253			f2fs_warn(sbi, "%s: inode (ino=%lx) has corrupted i_inline_xattr_size: %d, max: %zu",
   254				  __func__, inode->i_ino, fi->i_inline_xattr_size,
   255				  MAX_INLINE_XATTR_SIZE);
   256			return false;
   257		}
   258	
   259		if (F2FS_I(inode)->extent_tree) {
   260			struct extent_info *ei = &F2FS_I(inode)->extent_tree->largest;
   261	
   262			if (ei->len &&
   263				(!f2fs_is_valid_blkaddr(sbi, ei->blk,
   264							DATA_GENERIC_ENHANCE) ||
   265				!f2fs_is_valid_blkaddr(sbi, ei->blk + ei->len - 1,
   266							DATA_GENERIC_ENHANCE))) {
   267				set_sbi_flag(sbi, SBI_NEED_FSCK);
   268				f2fs_warn(sbi, "%s: inode (ino=%lx) extent info [%u, %u, %u] is incorrect, run fsck to fix",
   269					  __func__, inode->i_ino,
   270					  ei->blk, ei->fofs, ei->len);
   271				return false;
   272			}
   273		}
   274	
   275		if (f2fs_has_inline_data(inode) &&
   276				(!S_ISREG(inode->i_mode) && !S_ISLNK(inode->i_mode))) {
   277			set_sbi_flag(sbi, SBI_NEED_FSCK);
   278			f2fs_warn(sbi, "%s: inode (ino=%lx, mode=%u) should not have inline_data, run fsck to fix",
   279				  __func__, inode->i_ino, inode->i_mode);
   280			return false;
   281		}
   282	
   283		if (f2fs_has_inline_dentry(inode) && !S_ISDIR(inode->i_mode)) {
   284			set_sbi_flag(sbi, SBI_NEED_FSCK);
   285			f2fs_warn(sbi, "%s: inode (ino=%lx, mode=%u) should not have inline_dentry, run fsck to fix",
   286				  __func__, inode->i_ino, inode->i_mode);
   287			return false;
   288		}
   289	
   290		if (f2fs_has_extra_attr(inode) && f2fs_sb_has_compression(sbi) &&
   291				fi->i_flags & F2FS_COMPR_FL &&
   292				F2FS_FITS_IN_INODE(ri, fi->i_extra_isize,
   293							i_log_cluster_size)) {
   294			if (ri->i_compress_algorithm >= COMPRESS_MAX) {
   295				f2fs_warn(sbi, "%s: inode (ino=%lx) has unsupported "
   296					"compress algorithm: %u, run fsck to fix",
   297					  __func__, inode->i_ino,
   298					  ri->i_compress_algorithm);
   299				return false;
   300			}
   301			if (le64_to_cpu(ri->i_compr_blocks) >
   302					SECTOR_TO_BLOCK(inode->i_blocks)) {
   303				f2fs_warn(sbi, "%s: inode (ino=%lx) has inconsistent "
   304					"i_compr_blocks:%llu, i_blocks:%lu, run fsck to fix",
   305					  __func__, inode->i_ino,
   306					  le64_to_cpu(ri->i_compr_blocks),
 > 307					  SECTOR_TO_BLOCK(inode->i_blocks));
   308				return false;
   309			}
   310			if (ri->i_log_cluster_size < MIN_COMPRESS_LOG_SIZE ||
   311				ri->i_log_cluster_size > MAX_COMPRESS_LOG_SIZE) {
   312				f2fs_warn(sbi, "%s: inode (ino=%lx) has unsupported "
   313					"log cluster size: %u, run fsck to fix",
   314					  __func__, inode->i_ino,
   315					  ri->i_log_cluster_size);
   316				return false;
   317			}
   318		}
   319	
   320		return true;
   321	}
   322	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 29757 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-27  2:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-27  2:22 [android-common:android-4.19-stable 1/1] fs/f2fs/inode.c:307:7: warning: format specifies type 'unsigned long' but the argument has type 'blkcnt_t' (aka 'unsigned long long') kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.