CC: [email protected]
CC: [email protected]
In-Reply-To: <[email protected]>
References: <[email protected]>
TO: Gao Xiang <[email protected]>

Hi Gao,

I love your patch! Perhaps something to improve:

[auto build test WARNING on xiang-erofs/dev-test]
[also build test WARNING on next-20210820]
[cannot apply to v5.14-rc6]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    
https://github.com/0day-ci/linux/commits/Gao-Xiang/erofs-introduce-chunk-based-file-on-disk-format/20210820-190035
base:   https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git dev-test
:::::: branch date: 24 hours ago
:::::: commit date: 24 hours ago
config: i386-randconfig-c001-20210820 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 
d9c5613e856cf2addfbf892fc4c1ce9ef9feceaa)
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
        # 
https://github.com/0day-ci/linux/commit/7fe675691d4b693aa4d499a0902ede8aa74b8d32
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review 
Gao-Xiang/erofs-introduce-chunk-based-file-on-disk-format/20210820-190035
        git checkout 7fe675691d4b693aa4d499a0902ede8aa74b8d32
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386 
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 >>)
                                ^
   include/linux/percpu-defs.h:446:2: note: expanded from macro 
'__this_cpu_read'
           raw_cpu_read(pcp);                                              \
           ^
   include/linux/percpu-defs.h:420:28: note: expanded from macro 'raw_cpu_read'
   #define raw_cpu_read(pcp)               
__pcpu_size_call_return(raw_cpu_read_, pcp)
                                           ^
   include/linux/percpu-defs.h:320:2: note: expanded from macro 
'__pcpu_size_call_return'
           switch(sizeof(variable)) {                                      \
           ^
   arch/x86/mm/tlb.c:1170:12: note:  Execution continues on line 1170
           int cpu = get_cpu();
                     ^
   include/linux/smp.h:268:42: note: expanded from macro 'get_cpu'
   #define get_cpu()               ({ preempt_disable(); __smp_processor_id(); 
})
                                                         ^
   arch/x86/include/asm/smp.h:159:30: note: expanded from macro 
'__smp_processor_id'
   #define __smp_processor_id() __this_cpu_read(cpu_number)
                                ^
   include/linux/percpu-defs.h:446:2: note: expanded from macro 
'__this_cpu_read'
           raw_cpu_read(pcp);                                              \
           ^
   include/linux/percpu-defs.h:420:28: note: expanded from macro 'raw_cpu_read'
   #define raw_cpu_read(pcp)               
__pcpu_size_call_return(raw_cpu_read_, pcp)
                                           ^
   include/linux/percpu-defs.h:323:42: note: expanded from macro 
'__pcpu_size_call_return'
           case 4: pscr_ret__ = stem##4(variable); break;                  \
                                                   ^
   arch/x86/mm/tlb.c:1178:6: note: Assuming the condition is true
           if (cpumask_any_but(&batch->cpumask, cpu) < nr_cpu_ids) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/mm/tlb.c:1178:2: note: Taking true branch
           if (cpumask_any_but(&batch->cpumask, cpu) < nr_cpu_ids) {
           ^
   arch/x86/mm/tlb.c:1179:3: note: Calling 'flush_tlb_multi'
                   flush_tlb_multi(&batch->cpumask, info);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/mm/tlb.c:868:2: note: Calling '__flush_tlb_multi'
           __flush_tlb_multi(cpumask, info);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/include/asm/paravirt.h:87:2: note: Assigned value is garbage or 
undefined
           PVOP_VCALL2(mmu.flush_tlb_multi, cpumask, info);
           ^
   arch/x86/include/asm/paravirt_types.h:547:2: note: expanded from macro 
'PVOP_VCALL2'
           __PVOP_VCALL(op, PVOP_CALL_ARG1(arg1), PVOP_CALL_ARG2(arg2))
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/include/asm/paravirt_types.h:491:8: note: expanded from macro 
'__PVOP_VCALL'
           (void)____PVOP_CALL(, op, CLBR_ANY, PVOP_VCALL_CLOBBERS,        \
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/include/asm/paravirt_types.h:446:3: note: expanded from macro 
'____PVOP_CALL'
                   PVOP_CALL_ARGS;                                         \
                   ^~~~~~~~~~~~~~
   arch/x86/include/asm/paravirt_types.h:386:16: note: expanded from macro 
'PVOP_CALL_ARGS'
           unsigned long __eax = __eax, __edx = __edx, __ecx = __ecx;
                         ^       ~~~~~
   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.
   13 warnings generated.
   fs/erofs/inode.c:50:3: warning: Value stored to 'err' is never read 
[clang-analyzer-deadcode.DeadStores]
                   err = -EOPNOTSUPP;
                   ^     ~~~~~~~~~~~
   fs/erofs/inode.c:50:3: note: Value stored to 'err' is never read
                   err = -EOPNOTSUPP;
                   ^     ~~~~~~~~~~~
   fs/erofs/inode.c:58:3: warning: Value stored to 'err' is never read 
[clang-analyzer-deadcode.DeadStores]
                   err = -EOPNOTSUPP;
                   ^     ~~~~~~~~~~~
   fs/erofs/inode.c:58:3: note: Value stored to 'err' is never read
                   err = -EOPNOTSUPP;
                   ^     ~~~~~~~~~~~
   fs/erofs/inode.c:74:5: warning: Value stored to 'err' is never read 
[clang-analyzer-deadcode.DeadStores]
                                   err = -ENOMEM;
                                   ^     ~~~~~~~
   fs/erofs/inode.c:74:5: note: Value stored to 'err' is never read
                                   err = -ENOMEM;
                                   ^     ~~~~~~~
   fs/erofs/inode.c:173:3: warning: Value stored to 'err' is never read 
[clang-analyzer-deadcode.DeadStores]
                   err = -EOPNOTSUPP;
                   ^     ~~~~~~~~~~~
   fs/erofs/inode.c:173:3: note: Value stored to 'err' is never read
                   err = -EOPNOTSUPP;
                   ^     ~~~~~~~~~~~
   fs/erofs/inode.c:182:4: warning: Value stored to 'err' is never read 
[clang-analyzer-deadcode.DeadStores]
                           err = -EOPNOTSUPP;
                           ^     ~~~~~~~~~~~
   fs/erofs/inode.c:182:4: note: Value stored to 'err' is never read
                           err = -EOPNOTSUPP;
                           ^     ~~~~~~~~~~~
   fs/erofs/inode.c:207:2: warning: Value stored to 'err' is never read 
[clang-analyzer-deadcode.DeadStores]
           err = -EFSCORRUPTED;
           ^     ~~~~~~~~~~~~~
   fs/erofs/inode.c:207:2: note: Value stored to 'err' is never read
           err = -EFSCORRUPTED;
           ^     ~~~~~~~~~~~~~
   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/erofs/data.c:178:20: warning: The left operand of '&' is a garbage value 
>> [clang-analyzer-core.UndefinedBinaryOperatorResult]
           if (!(map.m_flags & EROFS_MAP_MAPPED)) {
                 ~~~~~~~~~~~ ^
   fs/erofs/data.c:167:8: note: Calling 'erofs_map_blocks'
           ret = erofs_map_blocks(inode, &map, EROFS_GET_BLOCKS_RAW);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/erofs/data.c:84:27: note: Left side of '&&' is false
           struct erofs_inode *vi = EROFS_I(inode);
                                    ^
   fs/erofs/internal.h:282:2: note: expanded from macro 'EROFS_I'
           container_of(ptr, struct erofs_inode, vfs_inode)
           ^
   include/linux/kernel.h:495:61: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
                                                                      ^
   fs/erofs/data.c:84:27: note: Taking false branch
           struct erofs_inode *vi = EROFS_I(inode);
                                    ^
   fs/erofs/internal.h:282:2: note: expanded from macro 'EROFS_I'
           container_of(ptr, struct erofs_inode, vfs_inode)
           ^
   include/linux/kernel.h:495:2: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
           ^
   include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
   #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                       ^
   include/linux/compiler_types.h:328:2: note: expanded from macro 
'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
           ^
   include/linux/compiler_types.h:316:2: note: expanded from macro 
'_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:308:3: note: expanded from macro 
'__compiletime_assert'
                   if (!(condition))                                       \
                   ^
   fs/erofs/data.c:84:27: note: Loop condition is false.  Exiting loop
           struct erofs_inode *vi = EROFS_I(inode);
                                    ^
   fs/erofs/internal.h:282:2: note: expanded from macro 'EROFS_I'
           container_of(ptr, struct erofs_inode, vfs_inode)
           ^
   include/linux/kernel.h:495:2: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
           ^
   include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
   #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                       ^
   include/linux/compiler_types.h:328:2: note: expanded from macro 
'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
           ^
   include/linux/compiler_types.h:316:2: note: expanded from macro 
'_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:306:2: note: expanded from macro 
'__compiletime_assert'
           do {                                                            \
           ^
   fs/erofs/data.c:92:6: note: Assuming field 'm_la' is < field 'i_size'
           if (map->m_la >= inode->i_size) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/erofs/data.c:92:2: note: Taking false branch
           if (map->m_la >= inode->i_size) {
           ^
   fs/erofs/data.c:99:6: note: Assuming field 'datalayout' is equal to 
EROFS_INODE_CHUNK_BASED
           if (vi->datalayout != EROFS_INODE_CHUNK_BASED)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/erofs/data.c:99:2: note: Taking false branch
           if (vi->datalayout != EROFS_INODE_CHUNK_BASED)
           ^
   fs/erofs/data.c:102:6: note: Assuming the condition is false
           if (vi->chunkformat & EROFS_CHUNK_FORMAT_INDEXES)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/erofs/data.c:102:2: note: Taking false branch
           if (vi->chunkformat & EROFS_CHUNK_FORMAT_INDEXES)
           ^
   fs/erofs/data.c:112:2: note: Taking true branch
           if (IS_ERR(page))
           ^
   fs/erofs/data.c:113:3: note: Returning without writing to 'map->m_flags'
                   return PTR_ERR(page);
                   ^
   fs/erofs/data.c:167:8: note: Returning from 'erofs_map_blocks'
           ret = erofs_map_blocks(inode, &map, EROFS_GET_BLOCKS_RAW);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/erofs/data.c:168:6: note: 'ret' is >= 0
           if (ret < 0)
               ^~~
   fs/erofs/data.c:168:2: note: Taking false branch
           if (ret < 0)
           ^
   fs/erofs/data.c:178:20: note: The left operand of '&' is a garbage value
           if (!(map.m_flags & EROFS_MAP_MAPPED)) {
                 ~~~~~~~~~~~ ^
   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.
   Suppressed 10 warnings (10 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.
   fs/nls/nls_base.c:227:10: warning: Dereference of null pointer 
[clang-analyzer-core.NullDereference]
                           *op++ = (u8) u;

vim +178 fs/erofs/data.c

7fe675691d4b69 Gao Xiang    2021-08-19  157  
a08e67a0280215 Huang Jianan 2021-08-05  158  static int 
erofs_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
a08e67a0280215 Huang Jianan 2021-08-05  159             unsigned int flags, 
struct iomap *iomap, struct iomap *srcmap)
a08e67a0280215 Huang Jianan 2021-08-05  160  {
a08e67a0280215 Huang Jianan 2021-08-05  161     int ret;
a08e67a0280215 Huang Jianan 2021-08-05  162     struct erofs_map_blocks map;
a08e67a0280215 Huang Jianan 2021-08-05  163  
a08e67a0280215 Huang Jianan 2021-08-05  164     map.m_la = offset;
a08e67a0280215 Huang Jianan 2021-08-05  165     map.m_llen = length;
a08e67a0280215 Huang Jianan 2021-08-05  166  
7fe675691d4b69 Gao Xiang    2021-08-19  167     ret = erofs_map_blocks(inode, 
&map, EROFS_GET_BLOCKS_RAW);
a08e67a0280215 Huang Jianan 2021-08-05  168     if (ret < 0)
a08e67a0280215 Huang Jianan 2021-08-05  169             return ret;
a08e67a0280215 Huang Jianan 2021-08-05  170  
a08e67a0280215 Huang Jianan 2021-08-05  171     iomap->bdev = 
inode->i_sb->s_bdev;
06252e9ce05b94 Gao Xiang    2021-08-05  172     iomap->dax_dev = 
EROFS_I_SB(inode)->dax_dev;
a08e67a0280215 Huang Jianan 2021-08-05  173     iomap->offset = map.m_la;
a08e67a0280215 Huang Jianan 2021-08-05  174     iomap->length = map.m_llen;
a08e67a0280215 Huang Jianan 2021-08-05  175     iomap->flags = 0;
771c994ea51f57 Gao Xiang    2021-08-05  176     iomap->private = NULL;
a08e67a0280215 Huang Jianan 2021-08-05  177  
a08e67a0280215 Huang Jianan 2021-08-05 @178     if (!(map.m_flags & 
EROFS_MAP_MAPPED)) {
a08e67a0280215 Huang Jianan 2021-08-05  179             iomap->type = 
IOMAP_HOLE;
a08e67a0280215 Huang Jianan 2021-08-05  180             iomap->addr = 
IOMAP_NULL_ADDR;
a08e67a0280215 Huang Jianan 2021-08-05  181             if (!iomap->length)
a08e67a0280215 Huang Jianan 2021-08-05  182                     iomap->length = 
length;
a08e67a0280215 Huang Jianan 2021-08-05  183             return 0;
a08e67a0280215 Huang Jianan 2021-08-05  184     }
a08e67a0280215 Huang Jianan 2021-08-05  185  
a08e67a0280215 Huang Jianan 2021-08-05  186     if (map.m_flags & 
EROFS_MAP_META) {
771c994ea51f57 Gao Xiang    2021-08-05  187             struct page *ipage;
771c994ea51f57 Gao Xiang    2021-08-05  188  
771c994ea51f57 Gao Xiang    2021-08-05  189             iomap->type = 
IOMAP_INLINE;
771c994ea51f57 Gao Xiang    2021-08-05  190             ipage = 
erofs_get_meta_page(inode->i_sb,
771c994ea51f57 Gao Xiang    2021-08-05  191                                     
    erofs_blknr(map.m_pa));
771c994ea51f57 Gao Xiang    2021-08-05  192             if (IS_ERR(ipage))
771c994ea51f57 Gao Xiang    2021-08-05  193                     return 
PTR_ERR(ipage);
771c994ea51f57 Gao Xiang    2021-08-05  194             iomap->inline_data = 
page_address(ipage) +
771c994ea51f57 Gao Xiang    2021-08-05  195                                     
erofs_blkoff(map.m_pa);
771c994ea51f57 Gao Xiang    2021-08-05  196             iomap->private = ipage;
771c994ea51f57 Gao Xiang    2021-08-05  197     } else {
a08e67a0280215 Huang Jianan 2021-08-05  198             iomap->type = 
IOMAP_MAPPED;
a08e67a0280215 Huang Jianan 2021-08-05  199             iomap->addr = map.m_pa;
771c994ea51f57 Gao Xiang    2021-08-05  200     }
a08e67a0280215 Huang Jianan 2021-08-05  201     return 0;
a08e67a0280215 Huang Jianan 2021-08-05  202  }
a08e67a0280215 Huang Jianan 2021-08-05  203  

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