CC: l...@lists.linux.dev
CC: kbuild-...@lists.01.org
CC: "Darrick J. Wong" <darrick.w...@oracle.com>
CC: linux-ker...@vger.kernel.org
TO: "Darrick J. Wong" <djw...@kernel.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git 
vectorized-scrub
head:   f7b5acb4dc5e8a3845296b4662732360360b776e
commit: b5e92cc0883a72a43c262daa8fbbbbaecce72e21 [245/358] xfs: support logging 
EFIs for realtime extents
:::::: branch date: 21 hours ago
:::::: commit date: 21 hours ago
config: riscv-randconfig-c006-20210826 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 
ea08c4cd1c0869ec5024a8bb3f5cdf06ab03ae83)
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 riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # 
https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git/commit/?id=b5e92cc0883a72a43c262daa8fbbbbaecce72e21
        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 b5e92cc0883a72a43c262daa8fbbbbaecce72e21
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv 
clang-analyzer 

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


clang-analyzer warnings: (new ones prefixed by >>)
           ^
   include/linux/cpumask.h:241:2: note: expanded from macro 'for_each_cpu'
           for ((cpu) = -1;                                \
           ^
   kernel/sched/topology.c:2152:2: note: Assuming 'i' is < 'nr_cpu_ids'
           for_each_cpu(i, cpu_map) {
           ^
   include/linux/cpumask.h:243:3: note: expanded from macro 'for_each_cpu'
                   (cpu) < nr_cpu_ids;)
                   ^~~~~~~~~~~~~~~~~~
   kernel/sched/topology.c:2152:2: note: Loop condition is true.  Entering loop 
body
           for_each_cpu(i, cpu_map) {
           ^
   include/linux/cpumask.h:241:2: note: expanded from macro 'for_each_cpu'
           for ((cpu) = -1;                                \
           ^
   kernel/sched/topology.c:2153:14: note: Loop condition is false.  Exiting loop
                   for (sd = *per_cpu_ptr(d.sd, i); sd; sd = sd->parent) {
                              ^
   include/linux/percpu-defs.h:235:2: note: expanded from macro 'per_cpu_ptr'
           __verify_pcpu_ptr(ptr);                                         \
           ^
   include/linux/percpu-defs.h:217:37: note: expanded from macro 
'__verify_pcpu_ptr'
   #define __verify_pcpu_ptr(ptr)                                          \
                                                                           ^
   kernel/sched/topology.c:2153:3: note: Loop condition is true.  Entering loop 
body
                   for (sd = *per_cpu_ptr(d.sd, i); sd; sd = sd->parent) {
                   ^
   kernel/sched/topology.c:2155:8: note: Assuming the condition is false
                           if (sd->flags & SD_OVERLAP) {
                               ^~~~~~~~~~~~~~~~~~~~~~
   kernel/sched/topology.c:2155:4: note: Taking false branch
                           if (sd->flags & SD_OVERLAP) {
                           ^
   kernel/sched/topology.c:2159:9: note: Calling 'build_sched_groups'
                                   if (build_sched_groups(sd, i))
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/sched/topology.c:1194:37: note: 'last' initialized to a null pointer 
value
           struct sched_group *first = NULL, *last = NULL;
                                              ^~~~
   kernel/sched/topology.c:1200:2: note: Assuming 'debug_locks' is 0
           lockdep_assert_held(&sched_domains_mutex);
           ^
   include/linux/lockdep.h:310:11: note: expanded from macro 
'lockdep_assert_held'
                   WARN_ON(debug_locks &&                                  \
                           ^~~~~~~~~~~
   include/asm-generic/bug.h:121:25: note: expanded from macro 'WARN_ON'
           int __ret_warn_on = !!(condition);                              \
                                  ^~~~~~~~~
   kernel/sched/topology.c:1200:2: note: Left side of '&&' is false
           lockdep_assert_held(&sched_domains_mutex);
           ^
   include/linux/lockdep.h:310:23: note: expanded from macro 
'lockdep_assert_held'
                   WARN_ON(debug_locks &&                                  \
                                       ^
   kernel/sched/topology.c:1200:2: note: Taking false branch
           lockdep_assert_held(&sched_domains_mutex);
           ^
   include/linux/lockdep.h:310:3: note: expanded from macro 
'lockdep_assert_held'
                   WARN_ON(debug_locks &&                                  \
                   ^
   include/asm-generic/bug.h:122:2: note: expanded from macro 'WARN_ON'
           if (unlikely(__ret_warn_on))                                    \
           ^
   kernel/sched/topology.c:1200:2: note: Loop condition is false.  Exiting loop
           lockdep_assert_held(&sched_domains_mutex);
           ^
   include/linux/lockdep.h:309:32: note: expanded from macro 
'lockdep_assert_held'
   #define lockdep_assert_held(l)  do {                                    \
                                   ^
   kernel/sched/topology.c:1205:2: note: Assuming 'i' is >= 8
           for_each_cpu_wrap(i, span, cpu) {
           ^
   include/linux/cpumask.h:271:7: note: expanded from macro 'for_each_cpu_wrap'
                (cpu) < nr_cpumask_bits;                                        
   \
                ^~~~~~~~~~~~~~~~~~~~~~~
   kernel/sched/topology.c:1205:2: note: Loop condition is false. Execution 
continues on line 1221
           for_each_cpu_wrap(i, span, cpu) {
           ^
   include/linux/cpumask.h:270:2: note: expanded from macro 'for_each_cpu_wrap'
           for ((cpu) = cpumask_next_wrap((start)-1, (mask), (start), false);   
   \
           ^
   kernel/sched/topology.c:1221:13: note: Access to field 'next' results in a 
dereference of a null pointer (loaded from variable 'last')
           last->next = first;
           ~~~~       ^
   Suppressed 15 warnings (13 in non-user code, 2 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.
   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.
   9 warnings generated.
   Suppressed 9 warnings (9 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/libxfs/xfs_alloc.c:2564:3: warning: Value stored to 'agno' is never 
>> read [clang-analyzer-deadcode.DeadStores]
                   agno = 0;
                   ^      ~
   fs/xfs/libxfs/xfs_alloc.c:2564:3: note: Value stored to 'agno' is never read
                   agno = 0;
                   ^      ~
>> fs/xfs/libxfs/xfs_alloc.c:2565:3: warning: Value stored to 'agbno' is never 
>> read [clang-analyzer-deadcode.DeadStores]
                   agbno = bno;
                   ^       ~~~
   fs/xfs/libxfs/xfs_alloc.c:2565:3: note: Value stored to 'agbno' is never read
                   agbno = bno;
                   ^       ~~~
   fs/xfs/libxfs/xfs_alloc.c:3482:8: warning: Access to field 'b_addr' results 
in a dereference of a null pointer (loaded from variable 'agbp') 
[clang-analyzer-core.NullDereference]
           agf = agbp->b_addr;
                 ^~~~
   fs/xfs/libxfs/xfs_alloc.c:3468:9: note: Assuming 'len' is not equal to 0
           ASSERT(len != 0);
                  ^
   fs/xfs/xfs_linux.h:210:10: note: expanded from macro 'ASSERT'
           (likely(expr) ? (void)0 : assfail(NULL, #expr, __FILE__, __LINE__))
                   ^~~~
   include/linux/compiler.h:77:40: note: expanded from macro 'likely'
   # define likely(x)      __builtin_expect(!!(x), 1)
                                               ^
   fs/xfs/libxfs/xfs_alloc.c:3468:2: note: '?' condition is true
           ASSERT(len != 0);
           ^
   fs/xfs/xfs_linux.h:210:3: note: expanded from macro 'ASSERT'
           (likely(expr) ? (void)0 : assfail(NULL, #expr, __FILE__, __LINE__))
            ^
   include/linux/compiler.h:77:20: note: expanded from macro 'likely'
   # define likely(x)      __builtin_expect(!!(x), 1)
                           ^
   fs/xfs/libxfs/xfs_alloc.c:3469:9: note: Assuming 'type' is not equal to 
XFS_AG_RESV_AGFL
           ASSERT(type != XFS_AG_RESV_AGFL);
                  ^
   fs/xfs/xfs_linux.h:210:10: note: expanded from macro 'ASSERT'
           (likely(expr) ? (void)0 : assfail(NULL, #expr, __FILE__, __LINE__))
                   ^~~~
   include/linux/compiler.h:77:40: note: expanded from macro 'likely'
   # define likely(x)      __builtin_expect(!!(x), 1)
                                               ^
   fs/xfs/libxfs/xfs_alloc.c:3469:2: note: '?' condition is true
           ASSERT(type != XFS_AG_RESV_AGFL);
           ^
   fs/xfs/xfs_linux.h:210:3: note: expanded from macro 'ASSERT'
           (likely(expr) ? (void)0 : assfail(NULL, #expr, __FILE__, __LINE__))
            ^
   include/linux/compiler.h:77:20: note: expanded from macro 'likely'
   # define likely(x)      __builtin_expect(!!(x), 1)
                           ^
   fs/xfs/libxfs/xfs_alloc.c:3471:6: note: Left side of '||' is false
           if (XFS_TEST_ERROR(false, mp,
               ^
   fs/xfs/xfs_error.h:47:3: note: expanded from macro 'XFS_TEST_ERROR'
           ((expr) || xfs_errortag_test((mp), #expr, __FILE__, __LINE__, (tag)))
            ^
   fs/xfs/libxfs/xfs_alloc.c:3471:6: note: Assuming the condition is false
           if (XFS_TEST_ERROR(false, mp,
               ^
   fs/xfs/xfs_error.h:47:13: note: expanded from macro 'XFS_TEST_ERROR'
           ((expr) || xfs_errortag_test((mp), #expr, __FILE__, __LINE__, (tag)))
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/xfs/libxfs/xfs_alloc.c:3471:2: note: Taking false branch
           if (XFS_TEST_ERROR(false, mp,
           ^
   fs/xfs/libxfs/xfs_alloc.c:3476:10: note: Calling 
'xfs_free_extent_fix_freelist'
           error = xfs_free_extent_fix_freelist(tp, pag, &agbp);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/xfs/libxfs/xfs_alloc.c:3434:6: note: Assuming field 'agno' is < field 
'sb_agcount'
           if (args.agno >= args.mp->m_sb.sb_agcount)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/xfs/libxfs/xfs_alloc.c:3434:2: note: Taking false branch
           if (args.agno >= args.mp->m_sb.sb_agcount)
           ^
   fs/xfs/libxfs/xfs_alloc.c:3437:10: note: Calling 'xfs_alloc_fix_freelist'
           error = xfs_alloc_fix_freelist(&args, XFS_ALLOC_FLAG_FREEING);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/xfs/libxfs/xfs_alloc.c:2658:2: note: Assuming the condition is false
           ASSERT(tp->t_flags & XFS_TRANS_PERM_LOG_RES);
           ^
   fs/xfs/xfs_linux.h:210:3: note: expanded from macro 'ASSERT'
           (likely(expr) ? (void)0 : assfail(NULL, #expr, __FILE__, __LINE__))
            ^~~~~~~~~~~~
   include/linux/compiler.h:77:38: note: expanded from macro 'likely'
   # define likely(x)      __builtin_expect(!!(x), 1)
                                             ^~~~
   fs/xfs/libxfs/xfs_alloc.c:2658:2: note: '?' condition is true
           ASSERT(tp->t_flags & XFS_TRANS_PERM_LOG_RES);
           ^
   fs/xfs/xfs_linux.h:210:3: note: expanded from macro 'ASSERT'
           (likely(expr) ? (void)0 : assfail(NULL, #expr, __FILE__, __LINE__))
            ^
   include/linux/compiler.h:77:20: note: expanded from macro 'likely'
   # define likely(x)      __builtin_expect(!!(x), 1)
                           ^
   fs/xfs/libxfs/xfs_alloc.c:2660:6: note: Assuming field 'pagf_init' is not 
equal to 0, which participates in a condition later
           if (!pag->pagf_init) {
               ^~~~~~~~~~~~~~~
   fs/xfs/libxfs/xfs_alloc.c:2660:2: note: Taking false branch
           if (!pag->pagf_init) {
           ^
   fs/xfs/libxfs/xfs_alloc.c:2675:6: note: Assuming field 'pagf_metadata' is 0
           if (pag->pagf_metadata && (args->datatype & XFS_ALLOC_USERDATA) &&
               ^~~~~~~~~~~~~~~~~~
   fs/xfs/libxfs/xfs_alloc.c:2675:25: note: Left side of '&&' is false
           if (pag->pagf_metadata && (args->datatype & XFS_ALLOC_USERDATA) &&

vim +/agno +2564 fs/xfs/libxfs/xfs_alloc.c

f8f2835a9cf30007 Brian Foster    2018-05-07  2540  
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2541  /*
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2542   * Add the extent to the 
list of extents to be free at transaction end.
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2543   * The list is maintained 
sorted (by block number).
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2544   */
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2545  void
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2546  xfs_free_extent_later(
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2547       struct xfs_trans        
        *tp,
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2548       xfs_fsblock_t           
        bno,
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2549       xfs_filblks_t           
        len,
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2550       const struct 
xfs_owner_info     *oinfo,
6ebbff6ca9db1f8b Darrick J. Wong 2021-08-24  2551       unsigned int            
        flags)
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2552  {
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2553       struct 
xfs_extent_free_item     *new;           /* new element */
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2554  #ifdef DEBUG
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2555       struct xfs_mount        
        *mp = tp->t_mountp;
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2556       xfs_agnumber_t          
        agno;
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2557       xfs_agblock_t           
        agbno;
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2558  
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2559       ASSERT(bno != 
NULLFSBLOCK);
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2560       ASSERT(len > 0);
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2561       ASSERT(len <= 
MAXEXTLEN);
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2562       
ASSERT(!isnullstartblock(bno));
b5e92cc0883a72a4 Darrick J. Wong 2021-01-05  2563       if (flags & 
XFS_FREE_EXTENT_REALTIME) {
b5e92cc0883a72a4 Darrick J. Wong 2021-01-05 @2564               agno = 0;
b5e92cc0883a72a4 Darrick J. Wong 2021-01-05 @2565               agbno = bno;
b5e92cc0883a72a4 Darrick J. Wong 2021-01-05  2566               ASSERT(bno < 
mp->m_sb.sb_rblocks);
b5e92cc0883a72a4 Darrick J. Wong 2021-01-05  2567               ASSERT(len <= 
mp->m_sb.sb_rblocks);
b5e92cc0883a72a4 Darrick J. Wong 2021-01-05  2568               ASSERT(bno + 
len <= mp->m_sb.sb_rblocks);
b5e92cc0883a72a4 Darrick J. Wong 2021-01-05  2569       } else {
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2570               agno = 
XFS_FSB_TO_AGNO(mp, bno);
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2571               agbno = 
XFS_FSB_TO_AGBNO(mp, bno);
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2572               ASSERT(agno < 
mp->m_sb.sb_agcount);
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2573               ASSERT(agbno < 
mp->m_sb.sb_agblocks);
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2574               ASSERT(len < 
mp->m_sb.sb_agblocks);
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2575               ASSERT(agbno + 
len <= mp->m_sb.sb_agblocks);
b5e92cc0883a72a4 Darrick J. Wong 2021-01-05  2576       }
6ebbff6ca9db1f8b Darrick J. Wong 2021-08-24  2577       ASSERT(!(flags & 
~XFS_FREE_EXTENT_ALL_FLAGS));
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2578  #endif
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2579       
ASSERT(xfs_extent_free_item_zone != NULL);
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2580  
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2581       new = 
kmem_cache_alloc(xfs_extent_free_item_zone,
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2582                              
GFP_KERNEL | __GFP_NOFAIL);
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2583       new->xefi_startblock = 
bno;
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2584       new->xefi_blockcount = 
(xfs_extlen_t)len;
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2585       if (oinfo)
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2586               new->xefi_oinfo 
= *oinfo;
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2587       else
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2588               new->xefi_oinfo 
= XFS_RMAP_OINFO_SKIP_UPDATE;
6ebbff6ca9db1f8b Darrick J. Wong 2021-08-24  2589       new->xefi_skip_discard 
= !!(flags & XFS_FREE_EXTENT_SKIP_DISCARD);
b5e92cc0883a72a4 Darrick J. Wong 2021-01-05  2590       new->xefi_realtime = 
!!(flags & XFS_FREE_EXTENT_REALTIME);
d76394b9f294ec68 Darrick J. Wong 2021-08-24  2591  
d76394b9f294ec68 Darrick J. Wong 2021-08-24  2592       
trace_xfs_extent_free_defer(mp, XFS_FREE_EXTENT_REGULAR, new);
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2593       xfs_defer_add(tp, 
XFS_DEFER_OPS_TYPE_FREE, &new->xefi_list);
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2594  }
9751f5622c41dc9e Darrick J. Wong 2021-08-24  2595  

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

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-le...@lists.01.org

Reply via email to