CC: [email protected] CC: [email protected] CC: [email protected] TO: Gao Xiang <[email protected]> CC: Yue Hu <[email protected]>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: dd81e1c7d5fb126e5fbc5c9e334d7b3ec29a16a0 commit: 469407a3b5ed9390cfacb0363d1cc926a51f6a14 erofs: clean up erofs_map_blocks tracepoints date: 7 weeks ago :::::: branch date: 2 days ago :::::: commit date: 7 weeks ago config: x86_64-randconfig-c007 (https://download.01.org/0day-ci/archive/20220125/[email protected]/config) compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project f7b7138a62648f4019c55e4671682af1f851f295) 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://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=469407a3b5ed9390cfacb0363d1cc926a51f6a14 git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git git fetch --no-tags linus master git checkout 469407a3b5ed9390cfacb0363d1cc926a51f6a14 # save the config file to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 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 >>) 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 8 warnings generated. fs/gfs2/file.c:793:3: warning: Value stored to 'pages' is never read [clang-analyzer-deadcode.DeadStores] pages = min(pages, nr_dirtied); ^ fs/gfs2/file.c:793:3: note: Value stored to 'pages' is never read 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/gfs2/ops_fstype.c:852:2: warning: Value stored to 'jindex' is never read [clang-analyzer-deadcode.DeadStores] jindex = 0; ^ ~ fs/gfs2/ops_fstype.c:852:2: note: Value stored to 'jindex' is never read jindex = 0; ^ ~ 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. 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. 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. 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. 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. 8 warnings generated. Suppressed 8 warnings (8 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. 7 warnings generated. >> fs/erofs/data.c:143:15: warning: Assigned value is garbage or undefined >> [clang-analyzer-core.uninitialized.Assign] map->m_llen = map->m_plen; ^ fs/erofs/data.c:201:8: note: Calling 'erofs_map_blocks' ret = erofs_map_blocks(inode, &map, EROFS_GET_BLOCKS_RAW); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fs/erofs/data.c:81:2: note: Calling 'trace_erofs_map_blocks_enter' trace_erofs_map_blocks_enter(inode, map, flags); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/trace/events/erofs.h:172:1: note: Taking false branch DEFINE_EVENT(erofs__map_blocks_enter, erofs_map_blocks_enter, ^ include/linux/tracepoint.h:542:2: note: expanded from macro 'DEFINE_EVENT' DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) ^ include/linux/tracepoint.h:419:2: note: expanded from macro 'DECLARE_TRACE' __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), \ ^ include/linux/tracepoint.h:247:3: note: expanded from macro '__DECLARE_TRACE' if (static_key_false(&__tracepoint_##name.key)) \ ^ include/trace/events/erofs.h:172:1: note: Left side of '&&' is true DEFINE_EVENT(erofs__map_blocks_enter, erofs_map_blocks_enter, ^ include/linux/tracepoint.h:542:2: note: expanded from macro 'DEFINE_EVENT' DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) ^ include/linux/tracepoint.h:419:2: note: expanded from macro 'DECLARE_TRACE' __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), \ ^ include/linux/tracepoint.h:251:7: note: expanded from macro '__DECLARE_TRACE' if (IS_ENABLED(CONFIG_LOCKDEP) && (cond)) { \ ^ note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) include/linux/kconfig.h:24:22: note: expanded from macro '__or' #define __or(x, y) ___or(x, y) ^ include/linux/kconfig.h:25:23: note: expanded from macro '___or' #define ___or(x, y) ____or(__ARG_PLACEHOLDER_##x, y) ^ include/linux/kconfig.h:26:65: note: expanded from macro '____or' #define ____or(arg1_or_junk, y) __take_second_arg(arg1_or_junk 1, y) ^ include/trace/events/erofs.h:172:1: note: Loop condition is false. Exiting loop DEFINE_EVENT(erofs__map_blocks_enter, erofs_map_blocks_enter, ^ include/linux/tracepoint.h:542:2: note: expanded from macro 'DEFINE_EVENT' DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) ^ include/linux/tracepoint.h:420:15: note: expanded from macro 'DECLARE_TRACE' cpu_online(raw_smp_processor_id()), \ ^ arch/x86/include/asm/smp.h:166:33: note: expanded from macro 'raw_smp_processor_id' #define raw_smp_processor_id() this_cpu_read(cpu_number) ^ include/linux/percpu-defs.h:507:29: note: expanded from macro 'this_cpu_read' #define this_cpu_read(pcp) __pcpu_size_call_return(this_cpu_read_, pcp) ^ include/linux/percpu-defs.h:319:2: note: expanded from macro '__pcpu_size_call_return' __verify_pcpu_ptr(&(variable)); \ ^ include/linux/percpu-defs.h:217:37: note: expanded from macro '__verify_pcpu_ptr' #define __verify_pcpu_ptr(ptr) \ ^ include/trace/events/erofs.h:172:1: note: Control jumps to 'case 4:' at line 172 DEFINE_EVENT(erofs__map_blocks_enter, erofs_map_blocks_enter, ^ include/linux/tracepoint.h:542:2: note: expanded from macro 'DEFINE_EVENT' DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) ^ include/linux/tracepoint.h:420:15: note: expanded from macro 'DECLARE_TRACE' cpu_online(raw_smp_processor_id()), \ ^ arch/x86/include/asm/smp.h:166:33: note: expanded from macro 'raw_smp_processor_id' #define raw_smp_processor_id() this_cpu_read(cpu_number) ^ include/linux/percpu-defs.h:507:29: note: expanded from macro 'this_cpu_read' #define this_cpu_read(pcp) __pcpu_size_call_return(this_cpu_read_, pcp) ^ include/linux/percpu-defs.h:320:2: note: expanded from macro '__pcpu_size_call_return' switch(sizeof(variable)) { \ ^ include/trace/events/erofs.h:172:1: note: Execution continues on line 172 DEFINE_EVENT(erofs__map_blocks_enter, erofs_map_blocks_enter, ^ include/linux/tracepoint.h:542:2: note: expanded from macro 'DEFINE_EVENT' DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) ^ include/linux/tracepoint.h:420:15: note: expanded from macro 'DECLARE_TRACE' cpu_online(raw_smp_processor_id()), \ ^ arch/x86/include/asm/smp.h:166:33: note: expanded from macro 'raw_smp_processor_id' #define raw_smp_processor_id() this_cpu_read(cpu_number) ^ include/linux/percpu-defs.h:507:29: note: expanded from macro 'this_cpu_read' #define this_cpu_read(pcp) __pcpu_size_call_return(this_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; \ ^ include/trace/events/erofs.h:172:1: note: Assuming the condition is false vim +143 fs/erofs/data.c 81781b02f9845b drivers/staging/erofs/data.c Gao Xiang 2018-07-26 68 c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 69 static int erofs_map_blocks(struct inode *inode, c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 70 struct erofs_map_blocks *map, int flags) c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 71 { c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 72 struct super_block *sb = inode->i_sb; c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 73 struct erofs_inode *vi = EROFS_I(inode); c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 74 struct erofs_inode_chunk_index *idx; c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 75 struct page *page; c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 76 u64 chunknr; c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 77 unsigned int unit; c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 78 erofs_off_t pos; c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 79 int err = 0; c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 80 469407a3b5ed93 fs/erofs/data.c Gao Xiang 2021-12-09 81 trace_erofs_map_blocks_enter(inode, map, flags); dfeab2e95a75a4 fs/erofs/data.c Gao Xiang 2021-10-14 82 map->m_deviceid = 0; c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 83 if (map->m_la >= inode->i_size) { c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 84 /* leave out-of-bound access unmapped */ c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 85 map->m_flags = 0; c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 86 map->m_plen = 0; c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 87 goto out; c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 88 } c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 89 469407a3b5ed93 fs/erofs/data.c Gao Xiang 2021-12-09 90 if (vi->datalayout != EROFS_INODE_CHUNK_BASED) { 469407a3b5ed93 fs/erofs/data.c Gao Xiang 2021-12-09 91 err = erofs_map_blocks_flatmode(inode, map, flags); 469407a3b5ed93 fs/erofs/data.c Gao Xiang 2021-12-09 92 goto out; 469407a3b5ed93 fs/erofs/data.c Gao Xiang 2021-12-09 93 } c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 94 c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 95 if (vi->chunkformat & EROFS_CHUNK_FORMAT_INDEXES) c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 96 unit = sizeof(*idx); /* chunk index */ c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 97 else c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 98 unit = EROFS_BLOCK_MAP_ENTRY_SIZE; /* block map */ c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 99 c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 100 chunknr = map->m_la >> vi->chunkbits; c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 101 pos = ALIGN(iloc(EROFS_SB(sb), vi->nid) + vi->inode_isize + c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 102 vi->xattr_isize, unit) + unit * chunknr; c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 103 c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 104 page = erofs_get_meta_page(inode->i_sb, erofs_blknr(pos)); 469407a3b5ed93 fs/erofs/data.c Gao Xiang 2021-12-09 105 if (IS_ERR(page)) { 469407a3b5ed93 fs/erofs/data.c Gao Xiang 2021-12-09 106 err = PTR_ERR(page); 469407a3b5ed93 fs/erofs/data.c Gao Xiang 2021-12-09 107 goto out; 469407a3b5ed93 fs/erofs/data.c Gao Xiang 2021-12-09 108 } c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 109 map->m_la = chunknr << vi->chunkbits; c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 110 map->m_plen = min_t(erofs_off_t, 1UL << vi->chunkbits, c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 111 roundup(inode->i_size - map->m_la, EROFS_BLKSIZ)); c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 112 c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 113 /* handle block map */ c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 114 if (!(vi->chunkformat & EROFS_CHUNK_FORMAT_INDEXES)) { c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 115 __le32 *blkaddr = page_address(page) + erofs_blkoff(pos); c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 116 c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 117 if (le32_to_cpu(*blkaddr) == EROFS_NULL_ADDR) { c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 118 map->m_flags = 0; c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 119 } else { c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 120 map->m_pa = blknr_to_addr(le32_to_cpu(*blkaddr)); c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 121 map->m_flags = EROFS_MAP_MAPPED; c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 122 } c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 123 goto out_unlock; c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 124 } c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 125 /* parse chunk indexes */ c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 126 idx = page_address(page) + erofs_blkoff(pos); c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 127 switch (le32_to_cpu(idx->blkaddr)) { c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 128 case EROFS_NULL_ADDR: c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 129 map->m_flags = 0; c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 130 break; c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 131 default: dfeab2e95a75a4 fs/erofs/data.c Gao Xiang 2021-10-14 132 map->m_deviceid = le16_to_cpu(idx->device_id) & dfeab2e95a75a4 fs/erofs/data.c Gao Xiang 2021-10-14 133 EROFS_SB(sb)->device_id_mask; c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 134 map->m_pa = blknr_to_addr(le32_to_cpu(idx->blkaddr)); c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 135 map->m_flags = EROFS_MAP_MAPPED; c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 136 break; c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 137 } c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 138 out_unlock: c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 139 unlock_page(page); c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 140 put_page(page); c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 141 out: 469407a3b5ed93 fs/erofs/data.c Gao Xiang 2021-12-09 142 if (!err) c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 @143 map->m_llen = map->m_plen; 469407a3b5ed93 fs/erofs/data.c Gao Xiang 2021-12-09 144 trace_erofs_map_blocks_exit(inode, map, flags, 0); c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 145 return err; c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 146 } c5aa903a59db27 fs/erofs/data.c Gao Xiang 2021-08-20 147 :::::: The code at line 143 was first introduced by commit :::::: c5aa903a59db274554718cddfda9039913409ec9 erofs: support reading chunk-based uncompressed files :::::: TO: Gao Xiang <[email protected]> :::::: CC: Gao Xiang <[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]
