:::::: :::::: Manual check reason: "low confidence bisect report" :::::: Manual check reason: "commit no functional change" :::::: Manual check reason: "low confidence static check warning: fs/iomap/buffered-io.c:1175:14: warning: use of uninitialized value '*ioend.io_bio' [CWE-457] [-Wanalyzer-use-of-uninitialized-value]" ::::::
BCC: [email protected] CC: [email protected] CC: [email protected] TO: "Matthew Wilcox (Oracle)" <[email protected]> CC: Christoph Hellwig <[email protected]> CC: "Darrick J. Wong" <[email protected]> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 1612c382ffbdf1f673caec76502b1c00e6d35363 commit: 6e478521df535b9d5ef5eb84d4352f235bbbef99 iomap,xfs: Convert ->discard_page to ->discard_folio date: 8 months ago :::::: branch date: 10 hours ago :::::: commit date: 8 months ago config: arm-randconfig-c002-20220805 (https://download.01.org/0day-ci/archive/20220807/[email protected]/config) compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0 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=6e478521df535b9d5ef5eb84d4352f235bbbef99 git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git git fetch --no-tags linus master git checkout 6e478521df535b9d5ef5eb84d4352f235bbbef99 # save the config file COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross ARCH=arm KBUILD_USERCFLAGS='-fanalyzer -Wno-error' If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot <[email protected]> gcc-analyzer warnings: (new ones prefixed by >>) fs/iomap/buffered-io.c: In function 'iomap_submit_ioend': >> fs/iomap/buffered-io.c:1175:14: warning: use of uninitialized value >> '*ioend.io_bio' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 1175 | ioend->io_bio->bi_private = ioend; | ~~~~~^~~~~~~~ 'iomap_writepage_map': event 1 | | 1308 | iomap_writepage_map(struct iomap_writepage_ctx *wpc, | | ^~~~~~~~~~~~~~~~~~~ | | | | | (1) entry to 'iomap_writepage_map' | 'iomap_writepage_map': event 2 | | 1318 | LIST_HEAD(submit_list); | | ^~~~~~~~~~~ | | | | | (2) region created on stack here include/linux/list.h:26:26: note: in definition of macro 'LIST_HEAD' | 26 | struct list_head name = LIST_HEAD_INIT(name) | | ^~~~ | 'iomap_writepage_map': event 3 | |include/linux/once_lite.h:15:38: | 15 | bool __ret_do_once = !!(condition); \ | | ^~~~~~~~~~~~~ | | | | | (3) following 'false' branch (when 'iop' is NULL)... include/asm-generic/bug.h:146:9: note: in expansion of macro 'DO_ONCE_LITE_IF' | 146 | DO_ONCE_LITE_IF(condition, WARN_ON, 1) | | ^~~~~~~~~~~~~~~ fs/iomap/buffered-io.c:1320:9: note: in expansion of macro 'WARN_ON_ONCE' | 1320 | WARN_ON_ONCE(iop && atomic_read(&iop->write_bytes_pending) != 0); | | ^~~~~~~~~~~~ | 'iomap_writepage_map': event 4 | |cc1: | (4): ...to here | 'iomap_writepage_map': event 5 | |include/linux/once_lite.h:17:20: | 17 | if (unlikely(__ret_do_once && !__already_done)) { \ | | ^ | | | | | (5) following 'false' branch... include/asm-generic/bug.h:146:9: note: in expansion of macro 'DO_ONCE_LITE_IF' | 146 | DO_ONCE_LITE_IF(condition, WARN_ON, 1) | | ^~~~~~~~~~~~~~~ fs/iomap/buffered-io.c:1320:9: note: in expansion of macro 'WARN_ON_ONCE' | 1320 | WARN_ON_ONCE(iop && atomic_read(&iop->write_bytes_pending) != 0); | | ^~~~~~~~~~~~ | 'iomap_writepage_map': event 6 | |include/linux/pagemap.h:691:29: | 691 | return ((loff_t)page->index) << PAGE_SHIFT; | | ~~~~^~~~~~~ | | | | | (6) ...to here | 'iomap_writepage_map': event 7 | |include/linux/once_lite.h:17:20: | 17 | if (unlikely(__ret_do_once && !__already_done)) { \ | | ^ | | | | | (7) following 'false' branch... include/asm-generic/bug.h:146:9: note: in expansion of macro 'DO_ONCE_LITE_IF' | 146 | DO_ONCE_LITE_IF(condition, WARN_ON, 1) | | ^~~~~~~~~~~~~~~ fs/iomap/buffered-io.c:1345:9: note: in expansion of macro 'WARN_ON_ONCE' | 1345 | WARN_ON_ONCE(!wpc->ioend && !list_empty(&submit_list)); | | ^~~~~~~~~~~~ | 'iomap_writepage_map': event 8 | |include/asm-generic/rwonce.h:44:26: | 44 | #define __READ_ONCE(x) (*(const volatile __unqual_scalar_typeof(x) *)&(x)) | | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (8) ...to here include/asm-generic/rwonce.h:50:9: note: in expansion of macro '__READ_ONCE' | 50 | __READ_ONCE(x); \ | | ^~~~~~~~~~~ include/linux/page-flags.h:198:30: note: in expansion of macro 'READ_ONCE' | 198 | unsigned long head = READ_ONCE(page->compound_head); | | ^~~~~~~~~ | 'iomap_writepage_map': events 9-10 | |fs/iomap/buffered-io.c:1356:12: | 1356 | if (unlikely(error)) { | | ^ | | | | | (9) following 'false' branch... |...... | 1372 | set_page_writeback(page); | | ~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (10) ...to here vim +1175 fs/iomap/buffered-io.c 598ecfbaa742ac Christoph Hellwig 2019-10-17 1162 598ecfbaa742ac Christoph Hellwig 2019-10-17 1163 /* 598ecfbaa742ac Christoph Hellwig 2019-10-17 1164 * Submit the final bio for an ioend. 598ecfbaa742ac Christoph Hellwig 2019-10-17 1165 * 598ecfbaa742ac Christoph Hellwig 2019-10-17 1166 * If @error is non-zero, it means that we have a situation where some part of f1f264b4c134ee Andreas Gruenbacher 2021-08-02 1167 * the submission process has failed after we've marked pages for writeback 598ecfbaa742ac Christoph Hellwig 2019-10-17 1168 * and unlocked them. In this situation, we need to fail the bio instead of 598ecfbaa742ac Christoph Hellwig 2019-10-17 1169 * submitting it. This typically only happens on a filesystem shutdown. 598ecfbaa742ac Christoph Hellwig 2019-10-17 1170 */ 598ecfbaa742ac Christoph Hellwig 2019-10-17 1171 static int 598ecfbaa742ac Christoph Hellwig 2019-10-17 1172 iomap_submit_ioend(struct iomap_writepage_ctx *wpc, struct iomap_ioend *ioend, 598ecfbaa742ac Christoph Hellwig 2019-10-17 1173 int error) 598ecfbaa742ac Christoph Hellwig 2019-10-17 1174 { 598ecfbaa742ac Christoph Hellwig 2019-10-17 @1175 ioend->io_bio->bi_private = ioend; 598ecfbaa742ac Christoph Hellwig 2019-10-17 1176 ioend->io_bio->bi_end_io = iomap_writepage_end_bio; 598ecfbaa742ac Christoph Hellwig 2019-10-17 1177 598ecfbaa742ac Christoph Hellwig 2019-10-17 1178 if (wpc->ops->prepare_ioend) 598ecfbaa742ac Christoph Hellwig 2019-10-17 1179 error = wpc->ops->prepare_ioend(ioend, error); 598ecfbaa742ac Christoph Hellwig 2019-10-17 1180 if (error) { 598ecfbaa742ac Christoph Hellwig 2019-10-17 1181 /* f1f264b4c134ee Andreas Gruenbacher 2021-08-02 1182 * If we're failing the IO now, just mark the ioend with an 598ecfbaa742ac Christoph Hellwig 2019-10-17 1183 * error and finish it. This will run IO completion immediately 598ecfbaa742ac Christoph Hellwig 2019-10-17 1184 * as there is only one reference to the ioend at this point in 598ecfbaa742ac Christoph Hellwig 2019-10-17 1185 * time. 598ecfbaa742ac Christoph Hellwig 2019-10-17 1186 */ 598ecfbaa742ac Christoph Hellwig 2019-10-17 1187 ioend->io_bio->bi_status = errno_to_blk_status(error); 598ecfbaa742ac Christoph Hellwig 2019-10-17 1188 bio_endio(ioend->io_bio); 598ecfbaa742ac Christoph Hellwig 2019-10-17 1189 return error; 598ecfbaa742ac Christoph Hellwig 2019-10-17 1190 } 598ecfbaa742ac Christoph Hellwig 2019-10-17 1191 598ecfbaa742ac Christoph Hellwig 2019-10-17 1192 submit_bio(ioend->io_bio); 598ecfbaa742ac Christoph Hellwig 2019-10-17 1193 return 0; 598ecfbaa742ac Christoph Hellwig 2019-10-17 1194 } 598ecfbaa742ac Christoph Hellwig 2019-10-17 1195 :::::: The code at line 1175 was first introduced by commit :::::: 598ecfbaa742aca0dcdbbea25681406f95cc0b63 iomap: lift the xfs writeback code to iomap :::::: TO: Christoph Hellwig <[email protected]> :::::: CC: Darrick J. Wong <[email protected]> -- 0-DAY CI Kernel Test Service https://01.org/lkp _______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
