CC: [email protected]
CC: [email protected]
CC: "Darrick J. Wong" <[email protected]>
CC: [email protected]
TO: "Darrick J. Wong" <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git 
vectorized-scrub
head:   d404c6b945070ba14d8db1ee79daa5df149877df
commit: 6b591b18197c8fc41046f382956bb64d27566b79 [50/308] xfs: implement live 
quotacheck inode scan
:::::: branch date: 32 hours ago
:::::: commit date: 32 hours ago
config: arm-randconfig-c002-20211017 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 
746dd6a700931988dd9021d3d04718f1929885a5)
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
        # 
https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git/commit/?id=6b591b18197c8fc41046f382956bb64d27566b79
        git remote add djwong-xfs 
https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git
        git fetch --no-tags djwong-xfs vectorized-scrub
        git checkout 6b591b18197c8fc41046f382956bb64d27566b79
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm 
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 >>)
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
           ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to 
see all)
   include/linux/compiler_types.h:322:2: note: expanded from macro 
'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
           ^
   include/linux/compiler_types.h:310:2: note: expanded from macro 
'_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:300:2: note: expanded from macro 
'__compiletime_assert'
           do {                                                            \
           ^
   fs/reiserfs/journal.c:4318:7: note: Assuming 'journal->j_start' is > 
'temp_jl->j_start'
                   if (journal->j_start <= temp_jl->j_start) {
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/reiserfs/journal.c:4318:3: note: Taking false branch
                   if (journal->j_start <= temp_jl->j_start) {
                   ^
   fs/reiserfs/journal.c:4334:14: note: Assuming the condition is true
                   } else if ((journal->j_start +
                              ^~~~~~~~~~~~~~~~~~~
   fs/reiserfs/journal.c:4334:10: note: Taking true branch
                   } else if ((journal->j_start +
                          ^
   fs/reiserfs/journal.c:4337:8: note: Assuming the condition is true
                           if (((journal->j_start + journal->j_trans_max + 1) %
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/reiserfs/journal.c:4337:4: note: Taking true branch
                           if (((journal->j_start + journal->j_trans_max + 1) %
                           ^
   fs/reiserfs/journal.c:4340:5: note: Calling 'flush_used_journal_lists'
                                   flush_used_journal_lists(sb, temp_jl);
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/reiserfs/journal.c:1797:6: note: Assuming the condition is false
           if (reiserfs_data_log(s))
               ^
   fs/reiserfs/reiserfs.h:730:31: note: expanded from macro 'reiserfs_data_log'
   #define reiserfs_data_log(s) (REISERFS_SB(s)->s_mount_opt & (1 << 
REISERFS_DATA_LOG))
                                 
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/reiserfs/journal.c:1797:2: note: Taking false branch
           if (reiserfs_data_log(s))
           ^
   fs/reiserfs/journal.c:1800:14: note: 'i' is < 256
           for (i = 0; i < 256 && len < limit; i++) {
                       ^
   fs/reiserfs/journal.c:1800:14: note: Left side of '&&' is true
   fs/reiserfs/journal.c:1800:2: note: Loop condition is true.  Entering loop 
body
           for (i = 0; i < 256 && len < limit; i++) {
           ^
   fs/reiserfs/journal.c:1801:7: note: Assuming the condition is true
                   if (atomic_read(&tjl->j_commit_left) ||
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/reiserfs/journal.c:1801:40: note: Left side of '||' is true
                   if (atomic_read(&tjl->j_commit_left) ||
                                                        ^
   fs/reiserfs/journal.c:1803:4: note:  Execution continues on line 1815
                           break;
                           ^
   fs/reiserfs/journal.c:1823:6: note: 'flush_jl' is equal to 'jl'
           if (flush_jl != jl)
               ^~~~~~~~
   fs/reiserfs/journal.c:1823:2: note: Taking false branch
           if (flush_jl != jl)
           ^
   fs/reiserfs/journal.c:1828:2: note: Calling 'put_journal_list'
           put_journal_list(s, jl);
           ^~~~~~~~~~~~~~~~~~~~~~~
   fs/reiserfs/journal.c:551:10: note: Field 'j_refcount' is >= 1
           if (jl->j_refcount < 1) {
                   ^
   fs/reiserfs/journal.c:551:2: note: Taking false branch
           if (jl->j_refcount < 1) {
           ^
   fs/reiserfs/journal.c:555:6: note: Assuming the condition is true
           if (--jl->j_refcount == 0)
               ^~~~~~~~~~~~~~~~~~~~~
   fs/reiserfs/journal.c:555:2: note: Taking true branch
           if (--jl->j_refcount == 0)
           ^
   fs/reiserfs/journal.c:556:3: note: Memory is released
                   kfree(jl);
                   ^~~~~~~~~
   fs/reiserfs/journal.c:1828:2: note: Returning; memory was released
           put_journal_list(s, jl);
           ^~~~~~~~~~~~~~~~~~~~~~~
   fs/reiserfs/journal.c:4340:5: note: Returning; memory was released
                                   flush_used_journal_lists(sb, temp_jl);
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/reiserfs/journal.c:4341:5: note: Control jumps to line 4316
                                   goto first_jl;
                                   ^
   fs/reiserfs/journal.c:4316:21: note: Use of memory after it is freed
           list_for_each_safe(entry, safe, &journal->j_journal_list) {
                              ^
   include/linux/list.h:598:31: note: expanded from macro 'list_for_each_safe'
           for (pos = (head)->next, n = pos->next; pos != (head); \
                                        ^~~~~~~~~
   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.
>> fs/xfs/xfs_inode.c:3817:20: warning: Value stored to 'ifp' during its 
>> initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct xfs_ifork        *ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK);
                                    ^~~
   fs/xfs/xfs_inode.c:3817:20: note: Value stored to 'ifp' during its 
initialization is never read
           struct xfs_ifork        *ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK);
                                    ^~~
   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.
   10 warnings generated.
   fs/xfs/xfs_reflink.c:1176:3: warning: Value stored to 'qdelta' is never read 
[clang-analyzer-deadcode.DeadStores]
                   qdelta += dmap->br_blockcount;
                   ^         ~~~~~~~~~~~~~~~~~~~
   fs/xfs/xfs_reflink.c:1176:3: note: Value stored to 'qdelta' is never read
                   qdelta += dmap->br_blockcount;
                   ^         ~~~~~~~~~~~~~~~~~~~
   fs/xfs/xfs_reflink.c:1351:2: warning: Value stored to 'ret' is never read 
[clang-analyzer-deadcode.DeadStores]
           ret = -EINVAL;
           ^     ~~~~~~~
   fs/xfs/xfs_reflink.c:1351:2: note: Value stored to 'ret' is never read
           ret = -EINVAL;
           ^     ~~~~~~~
   Suppressed 8 warnings (7 in non-user code, 1 with check filters).
   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.
   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.
   8 warnings generated.
   security/keys/keyctl_pkey.c:132:8: warning: Dereference of null pointer 
[clang-analyzer-core.NullDereference]
           ret = params->key->type->asym_query(params, &info);
                 ^
   security/keys/keyctl_pkey.c:289:8: note: Calling 'keyctl_pkey_params_get_2'
           ret = keyctl_pkey_params_get_2(_params, _info, KEYCTL_PKEY_VERIFY,
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   security/keys/keyctl_pkey.c:122:2: note: Null pointer value stored to 
'params.key'
           memset(params, 0, sizeof(*params));
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   security/keys/keyctl_pkey.c:125:2: note: Taking false branch
           if (copy_from_user(&uparams, _params, sizeof(uparams)) != 0)
           ^
   security/keys/keyctl_pkey.c:128:8: note: Calling 'keyctl_pkey_params_get'
           ret = keyctl_pkey_params_get(uparams.key_id, _info, params);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   security/keys/keyctl_pkey.c:90:2: note: Taking true branch
           if (IS_ERR(p))
           ^
   security/keys/keyctl_pkey.c:91:3: note: Returning without writing to 
'params->key'
                   return PTR_ERR(p);
                   ^
   security/keys/keyctl_pkey.c:128:8: note: Returning from 
'keyctl_pkey_params_get'
           ret = keyctl_pkey_params_get(uparams.key_id, _info, params);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   security/keys/keyctl_pkey.c:129:6: note: 'ret' is >= 0
           if (ret < 0)
               ^~~
   security/keys/keyctl_pkey.c:129:2: note: Taking false branch
           if (ret < 0)
           ^
   security/keys/keyctl_pkey.c:132:8: note: Dereference of null pointer
           ret = params->key->type->asym_query(params, &info);
                 ^~~~~~~~~~~~~~~~~
   security/keys/keyctl_pkey.c:173:8: warning: Dereference of null pointer 
[clang-analyzer-core.NullDereference]
           ret = params.key->type->asym_query(&params, &res);
                 ^~~~~~~~~~~~~~~~
   security/keys/keyctl_pkey.c:169:8: note: Calling 'keyctl_pkey_params_get'
           ret = keyctl_pkey_params_get(id, _info, &params);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   security/keys/keyctl_pkey.c:86:2: note: Null pointer value stored to 
'params.key'
           memset(params, 0, sizeof(*params));
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   security/keys/keyctl_pkey.c:90:2: note: Taking true branch
           if (IS_ERR(p))
           ^
   security/keys/keyctl_pkey.c:169:8: note: Returning from 
'keyctl_pkey_params_get'
           ret = keyctl_pkey_params_get(id, _info, &params);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   security/keys/keyctl_pkey.c:170:6: note: 'ret' is >= 0
           if (ret < 0)

vim +/ifp +3817 fs/xfs/xfs_inode.c

6b591b18197c8f Darrick J. Wong 2021-09-01  3808  
6b591b18197c8f Darrick J. Wong 2021-09-01  3809  /* Compute the number of data 
and realtime blocks used by a file. */
6b591b18197c8f Darrick J. Wong 2021-09-01  3810  void
6b591b18197c8f Darrick J. Wong 2021-09-01  3811  xfs_inode_count_blocks(
6b591b18197c8f Darrick J. Wong 2021-09-01  3812         struct xfs_trans        
*tp,
6b591b18197c8f Darrick J. Wong 2021-09-01  3813         struct xfs_inode        
*ip,
6b591b18197c8f Darrick J. Wong 2021-09-01  3814         xfs_filblks_t           
*dblocks,
6b591b18197c8f Darrick J. Wong 2021-09-01  3815         xfs_filblks_t           
*rblocks)
6b591b18197c8f Darrick J. Wong 2021-09-01  3816  {
6b591b18197c8f Darrick J. Wong 2021-09-01 @3817         struct xfs_ifork        
*ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK);

---
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