CC: [email protected]
CC: [email protected]
CC: [email protected]
TO: Chao Yu <[email protected]>, Chao Yu <[email protected]>
CC: Jaegeuk Kim <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git 
dev-test
head:   94afd6d6e5253179c9b891d02081cc8355a11768
commit: 94afd6d6e5253179c9b891d02081cc8355a11768 [23/23] f2fs: extent cache: 
support unaligned extent
:::::: branch date: 20 hours ago
:::::: commit date: 20 hours ago
config: x86_64-randconfig-c001-20210805 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 
31a71a393f65d9e07b5b0756fef9dd16690950ee)
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 x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # 
https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/commit/?id=94afd6d6e5253179c9b891d02081cc8355a11768
        git remote add f2fs 
https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git
        git fetch --no-tags f2fs dev-test
        git checkout 94afd6d6e5253179c9b891d02081cc8355a11768
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 
clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>


clang-analyzer warnings: (new ones prefixed by >>)
   7 warnings generated.
   Suppressed 7 warnings (7 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   11 warnings generated.
   fs/xfs/xfs_iops.c:702:11: warning: Value stored to 'uid' during its 
initialization is never read [clang-analyzer-deadcode.DeadStores]
           kuid_t                  uid = GLOBAL_ROOT_UID, iuid = 
GLOBAL_ROOT_UID;
                                   ^~~
   fs/xfs/xfs_iops.c:702:11: note: Value stored to 'uid' during its 
initialization is never read
           kuid_t                  uid = GLOBAL_ROOT_UID, iuid = 
GLOBAL_ROOT_UID;
                                   ^~~
   fs/xfs/xfs_iops.c:702:34: warning: Value stored to 'iuid' during its 
initialization is never read [clang-analyzer-deadcode.DeadStores]
           kuid_t                  uid = GLOBAL_ROOT_UID, iuid = 
GLOBAL_ROOT_UID;
                                                          ^~~~
   fs/xfs/xfs_iops.c:702:34: note: Value stored to 'iuid' during its 
initialization is never read
           kuid_t                  uid = GLOBAL_ROOT_UID, iuid = 
GLOBAL_ROOT_UID;
                                                          ^~~~
   fs/xfs/xfs_iops.c:703:11: warning: Value stored to 'gid' during its 
initialization is never read [clang-analyzer-deadcode.DeadStores]
           kgid_t                  gid = GLOBAL_ROOT_GID, igid = 
GLOBAL_ROOT_GID;
                                   ^~~
   fs/xfs/xfs_iops.c:703:11: note: Value stored to 'gid' during its 
initialization is never read
           kgid_t                  gid = GLOBAL_ROOT_GID, igid = 
GLOBAL_ROOT_GID;
                                   ^~~
   fs/xfs/xfs_iops.c:703:34: warning: Value stored to 'igid' during its 
initialization is never read [clang-analyzer-deadcode.DeadStores]
           kgid_t                  gid = GLOBAL_ROOT_GID, igid = 
GLOBAL_ROOT_GID;
                                                          ^~~~
   fs/xfs/xfs_iops.c:703:34: note: Value stored to 'igid' during its 
initialization is never read
           kgid_t                  gid = GLOBAL_ROOT_GID, igid = 
GLOBAL_ROOT_GID;
                                                          ^~~~
   Suppressed 7 warnings (7 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   7 warnings generated.
   Suppressed 7 warnings (7 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   7 warnings generated.
   Suppressed 7 warnings (7 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   7 warnings generated.
   Suppressed 7 warnings (7 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   7 warnings generated.
   Suppressed 7 warnings (7 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   7 warnings generated.
   Suppressed 7 warnings (7 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   6 warnings generated.
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   7 warnings generated.
   Suppressed 7 warnings (7 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   6 warnings generated.
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   8 warnings generated.
   include/linux/math64.h:28:24: warning: Division by zero 
[clang-analyzer-core.DivideZero]
           *remainder = dividend % divisor;
                                 ^
   fs/f2fs/gc.c:308:23: note: Assuming the condition is true
           unsigned int secno = GET_SEC_FROM_SEG(sbi, segno);
                                ^
   fs/f2fs/segment.h:104:4: note: expanded from macro 'GET_SEC_FROM_SEG'
           (((segno) == -1) ? -1: (segno) / (sbi)->segs_per_sec)
             ^~~~~~~~~~~~~
   fs/f2fs/gc.c:308:23: note: '?' condition is true
           unsigned int secno = GET_SEC_FROM_SEG(sbi, segno);
                                ^
   fs/f2fs/segment.h:104:3: note: expanded from macro 'GET_SEC_FROM_SEG'
           (((segno) == -1) ? -1: (segno) / (sbi)->segs_per_sec)
            ^
   fs/f2fs/gc.c:315:2: note: 'usable_segs_per_sec' initialized here
           unsigned int usable_segs_per_sec = f2fs_usable_segs_in_sec(sbi, 
segno);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/f2fs/gc.c:317:14: note: Assuming 'i' is >= 'usable_segs_per_sec'
           for (i = 0; i < usable_segs_per_sec; i++)
                       ^~~~~~~~~~~~~~~~~~~~~~~
   fs/f2fs/gc.c:317:2: note: Loop condition is false. Execution continues on 
line 319
           for (i = 0; i < usable_segs_per_sec; i++)
           ^
   fs/f2fs/gc.c:321:25: note: Passing the value 0 via 2nd parameter 'divisor'
           mtime = div_u64(mtime, usable_segs_per_sec);
                                  ^~~~~~~~~~~~~~~~~~~
   fs/f2fs/gc.c:321:10: note: Calling 'div_u64'
           mtime = div_u64(mtime, usable_segs_per_sec);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/math64.h:128:31: note: Passing the value 0 via 2nd parameter 
'divisor'
           return div_u64_rem(dividend, divisor, &remainder);
                                        ^~~~~~~
   include/linux/math64.h:128:9: note: Calling 'div_u64_rem'
           return div_u64_rem(dividend, divisor, &remainder);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/math64.h:28:24: note: Division by zero
           *remainder = dividend % divisor;
                        ~~~~~~~~~^~~~~~~~~
   Suppressed 7 warnings (7 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   8 warnings generated.
>> fs/f2fs/f2fs.h:2607:6: warning: Branch condition evaluates to a garbage 
>> value [clang-analyzer-core.uninitialized.Branch]
           if (dn->node_page)
               ^
   fs/f2fs/data.c:2134:2: note: Assuming the condition is true
           f2fs_bug_on(sbi, f2fs_cluster_is_empty(cc));
           ^
   fs/f2fs/f2fs.h:36:7: note: expanded from macro 'f2fs_bug_on'
                   if (WARN_ON(condition))                                 \
                       ^~~~~~~~~~~~~~~~~~
   include/asm-generic/bug.h:121:23: note: expanded from macro 'WARN_ON'
           int __ret_warn_on = !!(condition);                              \
                                ^~~~~~~~~~~~
   fs/f2fs/data.c:2134:2: note: Taking false branch
           f2fs_bug_on(sbi, f2fs_cluster_is_empty(cc));
           ^
   fs/f2fs/f2fs.h:36:7: note: expanded from macro 'f2fs_bug_on'
                   if (WARN_ON(condition))                                 \
                       ^
   include/asm-generic/bug.h:122:2: note: expanded from macro 'WARN_ON'
           if (unlikely(__ret_warn_on))                                    \
           ^
   fs/f2fs/data.c:2134:2: note: Taking false branch
           f2fs_bug_on(sbi, f2fs_cluster_is_empty(cc));
           ^
   fs/f2fs/f2fs.h:36:3: note: expanded from macro 'f2fs_bug_on'
                   if (WARN_ON(condition))                                 \
                   ^
   fs/f2fs/data.c:2134:2: note: Loop condition is false.  Exiting loop
           f2fs_bug_on(sbi, f2fs_cluster_is_empty(cc));
           ^
   fs/f2fs/f2fs.h:35:2: note: expanded from macro 'f2fs_bug_on'
           do {                                                            \
           ^
   fs/f2fs/data.c:2140:14: note: Assuming 'i' is >= field 'cluster_size'
           for (i = 0; i < cc->cluster_size; i++) {
                       ^~~~~~~~~~~~~~~~~~~~
   fs/f2fs/data.c:2140:2: note: Loop condition is false. Execution continues on 
line 2158
           for (i = 0; i < cc->cluster_size; i++) {
           ^
   fs/f2fs/data.c:2158:6: note: Assuming the condition is false
           if (f2fs_cluster_is_empty(cc))
               ^~~~~~~~~~~~~~~~~~~~~~~~~
   fs/f2fs/data.c:2158:2: note: Taking false branch
           if (f2fs_cluster_is_empty(cc))
           ^
   fs/f2fs/data.c:2161:6: note: Assuming the condition is true
           if (f2fs_lookup_extent_cache(inode, start_idx, &ei))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/f2fs/data.c:2161:2: note: Taking true branch
           if (f2fs_lookup_extent_cache(inode, start_idx, &ei))
           ^
   fs/f2fs/data.c:2164:7: note: 'from_dnode' is false
           if (!from_dnode)
                ^~~~~~~~~~
   fs/f2fs/data.c:2164:2: note: Taking true branch
           if (!from_dnode)
           ^
   fs/f2fs/data.c:2165:3: note: Control jumps to line 2175
                   goto skip_reading_dnode;
                   ^
   fs/f2fs/data.c:2175:14: note: Assuming 'i' is >= field 'cluster_size'
           for (i = 1; i < cc->cluster_size; i++) {
                       ^~~~~~~~~~~~~~~~~~~~
   fs/f2fs/data.c:2175:2: note: Loop condition is false. Execution continues on 
line 2196
           for (i = 1; i < cc->cluster_size; i++) {
           ^
   fs/f2fs/data.c:2196:6: note: Assuming field 'nr_cpages' is not equal to 0
           if (cc->nr_cpages == 0) {
               ^~~~~~~~~~~~~~~~~~
   fs/f2fs/data.c:2196:2: note: Taking false branch
           if (cc->nr_cpages == 0) {
           ^
   fs/f2fs/data.c:2202:2: note: Taking false branch
           if (IS_ERR(dic)) {
           ^
   fs/f2fs/data.c:2207:14: note: Assuming 'i' is < field 'nr_cpages'
           for (i = 0; i < cc->nr_cpages; i++) {
                       ^~~~~~~~~~~~~~~~~
   fs/f2fs/data.c:2207:2: note: Loop condition is true.  Entering loop body
           for (i = 0; i < cc->nr_cpages; i++) {
           ^
   fs/f2fs/data.c:2212:13: note: 'from_dnode' is false
                   blkaddr = from_dnode ? data_blkaddr(dn.inode, dn.node_page,
                             ^~~~~~~~~~
   fs/f2fs/data.c:2212:13: note: '?' condition is false
   fs/f2fs/data.c:2218:7: note: Assuming the condition is false
                   if (f2fs_load_compressed_page(sbi, page, blkaddr)) {
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/f2fs/data.c:2218:3: note: Taking false branch
                   if (f2fs_load_compressed_page(sbi, page, blkaddr)) {
                   ^
   fs/f2fs/data.c:2224:7: note: Assuming 'bio' is null
                   if (bio && (!page_is_mergeable(sbi, bio,
                       ^~~
   fs/f2fs/data.c:2224:11: note: Left side of '&&' is false
                   if (bio && (!page_is_mergeable(sbi, bio,
                           ^
   fs/f2fs/data.c:2232:8: note: 'bio' is null
                   if (!bio) {
                        ^~~
   fs/f2fs/data.c:2232:3: note: Taking true branch

vim +2607 fs/f2fs/f2fs.h

39a53e0ce0df01 Jaegeuk Kim 2012-11-28  2604  
39a53e0ce0df01 Jaegeuk Kim 2012-11-28  2605  static inline void 
f2fs_put_dnode(struct dnode_of_data *dn)
39a53e0ce0df01 Jaegeuk Kim 2012-11-28  2606  {
39a53e0ce0df01 Jaegeuk Kim 2012-11-28 @2607     if (dn->node_page)
39a53e0ce0df01 Jaegeuk Kim 2012-11-28  2608             
f2fs_put_page(dn->node_page, 1);
39a53e0ce0df01 Jaegeuk Kim 2012-11-28  2609     if (dn->inode_page && 
dn->node_page != dn->inode_page)
39a53e0ce0df01 Jaegeuk Kim 2012-11-28  2610             
f2fs_put_page(dn->inode_page, 0);
39a53e0ce0df01 Jaegeuk Kim 2012-11-28  2611     dn->node_page = NULL;
39a53e0ce0df01 Jaegeuk Kim 2012-11-28  2612     dn->inode_page = NULL;
39a53e0ce0df01 Jaegeuk Kim 2012-11-28  2613  }
39a53e0ce0df01 Jaegeuk Kim 2012-11-28  2614  

:::::: The code at line 2607 was first introduced by commit
:::::: 39a53e0ce0df01b3cf4bb898c7ae2fd2189647d5 f2fs: add superblock and major 
in-memory structure

:::::: TO: Jaegeuk Kim <[email protected]>
:::::: CC: Jaegeuk Kim <[email protected]>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to