CC: [email protected]
CC: [email protected]
CC: [email protected]
TO: Rasmus Villemoes <[email protected]>
CC: Miguel Ojeda <[email protected]>
CC: Nick Desaulniers <[email protected]>
CC: Andrew Morton <[email protected]>
CC: Linux Memory Management List <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   3f667b5d4053ad54aee13dab5c94f04ff75ddfdf
commit: e1edc277e6f6dfb372216522dfc57f9381c39e35 linux/container_of.h: switch 
to static_assert
date:   6 weeks ago
:::::: branch date: 10 hours ago
:::::: commit date: 6 weeks ago
config: arm-randconfig-c002-20211215 
(https://download.01.org/0day-ci/archive/20211219/[email protected]/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 
dd245bab9fbb364faa1581e4f92ba3119a872fba)
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/torvalds/linux.git/commit/?id=e1edc277e6f6dfb372216522dfc57f9381c39e35
        git remote add linus 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout e1edc277e6f6dfb372216522dfc57f9381c39e35
        # save the config file 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/jfs/jfs_dmap.h:117:4: note: expanded from macro 'BMAPSZTOLEV'
           (((size) <= MAXL0SIZE) ? 0 : ((size) <= MAXL1SIZE) ? 1 : 2)
             ^~~~~~~~~~~~~~~~~~~
   fs/jfs/jfs_dmap.c:3404:21: note: '?' condition is true
           bmp->db_maxlevel = BMAPSZTOLEV(bmp->db_mapsize);
                              ^
   fs/jfs/jfs_dmap.h:117:3: note: expanded from macro 'BMAPSZTOLEV'
           (((size) <= MAXL0SIZE) ? 0 : ((size) <= MAXL1SIZE) ? 1 : 2)
            ^
   fs/jfs/jfs_dmap.c:3407:13: note: Calling 'dbGetL2AGSize'
           l2agsize = dbGetL2AGSize(newsize);
                      ^~~~~~~~~~~~~~~~~~~~~~
   fs/jfs/jfs_dmap.c:4001:6: note: Assuming the condition is false
           if (nblocks < BPERDMAP * MAXAG)
               ^
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : 
__trace_if_value(cond))
                                                      ^~~~
   fs/jfs/jfs_dmap.c:4001:2: note: '?' condition is false
           if (nblocks < BPERDMAP * MAXAG)
           ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:31: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : 
__trace_if_value(cond))
                                 ^
   fs/jfs/jfs_dmap.c:4001:2: note: '?' condition is false
           if (nblocks < BPERDMAP * MAXAG)
           ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:69: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : 
__trace_if_value(cond))
                                                                       ^
   include/linux/compiler.h:69:2: note: expanded from macro '__trace_if_value'
           (cond) ?                                        \
           ^
   fs/jfs/jfs_dmap.c:4001:2: note: Taking false branch
           if (nblocks < BPERDMAP * MAXAG)
           ^
   include/linux/compiler.h:56:23: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                         ^
   fs/jfs/jfs_dmap.c:4006:7: note: The value 64 is assigned to 'l2sz'
           for (l2sz = 64; l2sz >= 0; l2sz--, m >>= 1) {
                ^~~~~~~~~
   fs/jfs/jfs_dmap.c:4006:2: note: Loop condition is true.  Entering loop body
           for (l2sz = 64; l2sz >= 0; l2sz--, m >>= 1) {
           ^
   fs/jfs/jfs_dmap.c:4007:3: note: Assuming the condition is false
                   if (m & nblocks)
                   ^
   include/linux/compiler.h:56:45: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : 
__trace_if_value(cond))
                                                      ^~~~
   fs/jfs/jfs_dmap.c:4007:3: note: '?' condition is false
                   if (m & nblocks)
                   ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:31: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : 
__trace_if_value(cond))
                                 ^
   fs/jfs/jfs_dmap.c:4007:3: note: '?' condition is true
                   if (m & nblocks)
                   ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:69: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : 
__trace_if_value(cond))
                                                                       ^
   include/linux/compiler.h:69:2: note: expanded from macro '__trace_if_value'
           (cond) ?                                        \
           ^
   fs/jfs/jfs_dmap.c:4007:3: note: Taking true branch
                   if (m & nblocks)
                   ^
   include/linux/compiler.h:56:23: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                         ^
   fs/jfs/jfs_dmap.c:4008:4: note:  Execution continues on line 4011
                           break;
                           ^
   fs/jfs/jfs_dmap.c:4011:15: note: The result of the left shift is undefined 
due to shifting by '64', which is greater or equal to the width of type 's64'
           sz = (s64) 1 << l2sz;
                        ^  ~~~~
   Suppressed 15 warnings (15 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.
   17 warnings generated.
>> fs/btrfs/raid56.c:2708:7: warning: Use of memory after it is freed 
>> [clang-analyzer-unix.Malloc]
           if (!lock_stripe_add(rbio))
                ^
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                                                 ^~~~
   include/linux/compiler.h:58:86: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : 
__trace_if_value(cond))
                                                                                
        ^~~~
   include/linux/compiler.h:69:3: note: expanded from macro '__trace_if_value'
           (cond) ?                                        \
            ^~~~
   fs/btrfs/raid56.c:2708:7: note: Calling 'lock_stripe_add'
           if (!lock_stripe_add(rbio))
                ^
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                                                 ^~~~
   include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : 
__trace_if_value(cond))
                                                      ^~~~
   fs/btrfs/raid56.c:674:2: note: Loop condition is false.  Exiting loop
           spin_lock_irqsave(&h->lock, flags);
           ^
   include/linux/spinlock.h:392:2: note: expanded from macro 'spin_lock_irqsave'
           raw_spin_lock_irqsave(spinlock_check(lock), flags);     \
           ^
   include/linux/spinlock.h:253:2: note: expanded from macro 
'raw_spin_lock_irqsave'
           do {                                            \
           ^
   fs/btrfs/raid56.c:674:2: note: Loop condition is false.  Exiting loop
           spin_lock_irqsave(&h->lock, flags);
           ^
   include/linux/spinlock.h:390:43: note: expanded from macro 
'spin_lock_irqsave'
   #define spin_lock_irqsave(lock, flags)                          \
                                                                   ^
   fs/btrfs/raid56.c:675:2: note: Loop condition is true.  Entering loop body
           list_for_each_entry(cur, &h->hash_list, hash_list) {
           ^
   include/linux/list.h:630:2: note: expanded from macro 'list_for_each_entry'
           for (pos = list_first_entry(head, typeof(*pos), member);        \
           ^
   fs/btrfs/raid56.c:676:7: note: Assuming the condition is false
                   if (cur->bbio->raid_map[0] != rbio->bbio->raid_map[0])
                       ^
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                                                 ^~~~
   include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : 
__trace_if_value(cond))
                                                      ^~~~
   fs/btrfs/raid56.c:676:3: note: '?' condition is false
                   if (cur->bbio->raid_map[0] != rbio->bbio->raid_map[0])
                   ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:31: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : 
__trace_if_value(cond))
                                 ^
   fs/btrfs/raid56.c:676:3: note: '?' condition is false
                   if (cur->bbio->raid_map[0] != rbio->bbio->raid_map[0])
                   ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:69: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : 
__trace_if_value(cond))
                                                                       ^
   include/linux/compiler.h:69:2: note: expanded from macro '__trace_if_value'
           (cond) ?                                        \
           ^
   fs/btrfs/raid56.c:676:3: note: Taking false branch
                   if (cur->bbio->raid_map[0] != rbio->bbio->raid_map[0])
                   ^
   include/linux/compiler.h:56:23: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                         ^
   fs/btrfs/raid56.c:682:38: note: Left side of '&&' is false
                   if (bio_list_empty(&cur->bio_list) &&
                                                      ^
   fs/btrfs/raid56.c:682:3: note: '?' condition is false
                   if (bio_list_empty(&cur->bio_list) &&
                   ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:31: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : 
__trace_if_value(cond))
                                 ^
   fs/btrfs/raid56.c:682:38: note: Left side of '&&' is false
                   if (bio_list_empty(&cur->bio_list) &&
                                                      ^
   fs/btrfs/raid56.c:682:3: note: '?' condition is false
                   if (bio_list_empty(&cur->bio_list) &&
                   ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:69: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : 
__trace_if_value(cond))

vim +2708 fs/btrfs/raid56.c

b4ee1782686d5b Omar Sandoval 2015-06-19  2705  
b4ee1782686d5b Omar Sandoval 2015-06-19  2706  void 
raid56_submit_missing_rbio(struct btrfs_raid_bio *rbio)
b4ee1782686d5b Omar Sandoval 2015-06-19  2707  {
b4ee1782686d5b Omar Sandoval 2015-06-19 @2708   if (!lock_stripe_add(rbio))

:::::: The code at line 2708 was first introduced by commit
:::::: b4ee1782686d5b7a97826d67fdeaefaedbca23ce Btrfs: add RAID 5/6 
BTRFS_RBIO_REBUILD_MISSING operation

:::::: TO: Omar Sandoval <[email protected]>
:::::: CC: Chris Mason <[email protected]>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to