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: 13631516b02090441a5c788ae69b076009c44418 [196/308] xfs: support logging 
EFIs for realtime extents
:::::: branch date: 2 days ago
:::::: commit date: 2 days 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=13631516b02090441a5c788ae69b076009c44418
        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 13631516b02090441a5c788ae69b076009c44418
        # 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 >>)
                                                                      
^~~~~~~~~~~~~~~~~~
   fs/fscache/cookie.c:274:2: note: Taking false branch
           if (!index_key || !index_key_len || index_key_len > 255 || 
aux_data_len > 255)
           ^
   fs/fscache/cookie.c:276:6: note: Assuming 'aux_data' is null
           if (!aux_data || !aux_data_len) {
               ^~~~~~~~~
   fs/fscache/cookie.c:276:16: note: Left side of '||' is true
           if (!aux_data || !aux_data_len) {
                         ^
   fs/fscache/cookie.c:277:3: note: Null pointer value stored to 'aux_data'
                   aux_data = NULL;
                   ^~~~~~~~~~~~~~~
   fs/fscache/cookie.c:284:6: note: Assuming 'parent' is non-null
           if (!parent) {
               ^~~~~~~
   fs/fscache/cookie.c:284:2: note: Taking false branch
           if (!parent) {
           ^
   fs/fscache/cookie.c:291:9: note: Assuming the condition is false
           BUG_ON(!def->name[0]);
                  ^
   include/asm-generic/bug.h:65:45: note: expanded from macro 'BUG_ON'
   #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
                                               ^~~~~~~~~
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   fs/fscache/cookie.c:291:2: note: Taking false branch
           BUG_ON(!def->name[0]);
           ^
   include/asm-generic/bug.h:65:32: note: expanded from macro 'BUG_ON'
   #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
                                  ^
   fs/fscache/cookie.c:291:2: note: Loop condition is false.  Exiting loop
           BUG_ON(!def->name[0]);
           ^
   include/asm-generic/bug.h:65:27: note: expanded from macro 'BUG_ON'
   #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
                             ^
   fs/fscache/cookie.c:293:9: note: Assuming field 'type' is not equal to 0
           BUG_ON(def->type == FSCACHE_COOKIE_TYPE_INDEX &&
                  ^
   include/asm-generic/bug.h:65:45: note: expanded from macro 'BUG_ON'
   #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
                                      ~~~~~~~~~^~~~~~~~~~
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   fs/fscache/cookie.c:293:48: note: Left side of '&&' is false
           BUG_ON(def->type == FSCACHE_COOKIE_TYPE_INDEX &&
                                                         ^
   fs/fscache/cookie.c:293:2: note: Taking false branch
           BUG_ON(def->type == FSCACHE_COOKIE_TYPE_INDEX &&
           ^
   include/asm-generic/bug.h:65:32: note: expanded from macro 'BUG_ON'
   #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
                                  ^
   fs/fscache/cookie.c:293:2: note: Loop condition is false.  Exiting loop
           BUG_ON(def->type == FSCACHE_COOKIE_TYPE_INDEX &&
           ^
   include/asm-generic/bug.h:65:27: note: expanded from macro 'BUG_ON'
   #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
                             ^
   fs/fscache/cookie.c:298:7: note: Passing null pointer value via 5th 
parameter 'aux_data'
                                            aux_data, aux_data_len,
                                            ^~~~~~~~
   fs/fscache/cookie.c:296:14: note: Calling 'fscache_alloc_cookie'
           candidate = fscache_alloc_cookie(parent, def,
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/fscache/cookie.c:150:6: note: Assuming 'cookie' is non-null
           if (!cookie)
               ^~~~~~~
   fs/fscache/cookie.c:150:2: note: Taking false branch
           if (!cookie)
           ^
   fs/fscache/cookie.c:156:2: note: Taking false branch
           if (fscache_set_key(cookie, index_key, index_key_len) < 0)
           ^
   fs/fscache/cookie.c:159:6: note: Assuming the condition is true
           if (cookie->aux_len <= sizeof(cookie->inline_aux)) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/fscache/cookie.c:159:2: note: Taking true branch
           if (cookie->aux_len <= sizeof(cookie->inline_aux)) {
           ^
   fs/fscache/cookie.c:160:3: note: Null pointer passed as 2nd argument to 
memory copy function
                   memcpy(cookie->inline_aux, aux_data, cookie->aux_len);
                   ^                          ~~~~~~~~
   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.
   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.
   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:3483: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:3469: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:3469: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:3470: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:3470: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:3472: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:3472: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:3472:2: note: Taking false branch
           if (XFS_TEST_ERROR(false, mp,
           ^
   fs/xfs/libxfs/xfs_alloc.c:3477:10: note: Calling 
'xfs_free_extent_fix_freelist'
           error = xfs_free_extent_fix_freelist(tp, pag, &agbp);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/xfs/libxfs/xfs_alloc.c:3435:6: note: Assuming field 'agno' is < field 
'sb_agcount'
           if (args.agno >= args.mp->m_sb.sb_agcount)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/xfs/libxfs/xfs_alloc.c:3435:2: note: Taking false branch
           if (args.agno >= args.mp->m_sb.sb_agcount)
           ^
   fs/xfs/libxfs/xfs_alloc.c:3438:10: note: Calling 'xfs_alloc_fix_freelist'
           error = xfs_alloc_fix_freelist(&args, XFS_ALLOC_FLAG_FREEING);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/xfs/libxfs/xfs_alloc.c:2659: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:2659: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:2661:6: note: Assuming field 'pagf_init' is 0, 
which participates in a condition later
           if (!pag->pagf_init) {
               ^~~~~~~~~~~~~~~
   fs/xfs/libxfs/xfs_alloc.c:2661:2: note: Taking true branch
           if (!pag->pagf_init) {
           ^
   fs/xfs/libxfs/xfs_alloc.c:2663:7: note: Assuming 'error' is not equal to 0
                   if (error) {
                       ^~~~~
   fs/xfs/libxfs/xfs_alloc.c:2663:3: note: Taking true branch
                   if (error) {

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

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

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