* [ammarfaizi2-block:dhowells/linux-fs/netfs-maple 37/44] fs/netfs/buffered_write.c:757:6: warning: variable 'spare_region' is used uninitialized whenever 'if' condition is true
@ 2022-04-22 23:53 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-04-22 23:53 UTC (permalink / raw)
To: David Howells; +Cc: llvm, kbuild-all, GNU/Weeb Mailing List, linux-kernel
tree: https://github.com/ammarfaizi2/linux-block dhowells/linux-fs/netfs-maple
head: 931e50676c6598d0eda1954ead465519ff91874d
commit: 289cadcc7f9a897a36b3cba0e12083ce36182827 [37/44] netfs: Allow buffered shared-writeable mmap through netfs_page_mkwrite()
config: x86_64-randconfig-a016 (https://download.01.org/0day-ci/archive/20220423/[email protected]/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 5bd87350a5ae429baf8f373cb226a57b62f87280)
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/ammarfaizi2/linux-block/commit/289cadcc7f9a897a36b3cba0e12083ce36182827
git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
git fetch --no-tags ammarfaizi2-block dhowells/linux-fs/netfs-maple
git checkout 289cadcc7f9a897a36b3cba0e12083ce36182827
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash fs/netfs/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
All warnings (new ones prefixed by >>):
>> fs/netfs/buffered_write.c:757:6: warning: variable 'spare_region' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (mas_expected_entries(&mas, 2) < 0) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/netfs/buffered_write.c:793:30: note: uninitialized use occurs here
netfs_put_dirty_region(ctx, spare_region, netfs_region_trace_put_discard);
^~~~~~~~~~~~
fs/netfs/buffered_write.c:757:2: note: remove the 'if' if its condition is always false
if (mas_expected_entries(&mas, 2) < 0) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/netfs/buffered_write.c:754:6: warning: variable 'spare_region' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (folio_lock_killable(folio) < 0)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/netfs/buffered_write.c:793:30: note: uninitialized use occurs here
netfs_put_dirty_region(ctx, spare_region, netfs_region_trace_put_discard);
^~~~~~~~~~~~
fs/netfs/buffered_write.c:754:2: note: remove the 'if' if its condition is always false
if (folio_lock_killable(folio) < 0)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/netfs/buffered_write.c:751:6: warning: variable 'spare_region' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (folio_wait_writeback_killable(folio))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/netfs/buffered_write.c:793:30: note: uninitialized use occurs here
netfs_put_dirty_region(ctx, spare_region, netfs_region_trace_put_discard);
^~~~~~~~~~~~
fs/netfs/buffered_write.c:751:2: note: remove the 'if' if its condition is always false
if (folio_wait_writeback_killable(folio))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/netfs/buffered_write.c:734:41: note: initialize the variable 'spare_region' to silence this warning
struct netfs_dirty_region *spare_region;
^
= NULL
3 warnings generated.
vim +757 fs/netfs/buffered_write.c
727
728 /*
729 * Notification that a previously read-only page is about to become writable.
730 * Note that the caller indicates a single page of a multipage folio.
731 */
732 vm_fault_t netfs_page_mkwrite(struct vm_fault *vmf)
733 {
734 struct netfs_dirty_region *spare_region;
735 struct folio *folio = page_folio(vmf->page);
736 struct file *file = vmf->vma->vm_file;
737 struct inode *inode = file_inode(file);
738 struct netfs_i_context *ctx = netfs_i_context(inode);
739 vm_fault_t ret = VM_FAULT_RETRY;
740 int err;
741
742 MA_STATE(mas, &ctx->dirty_regions, vmf->page->index, PAGE_SIZE);
743
744 _enter("%lx", folio->index);
745
746 if (ctx->ops->validate_for_write(inode, file) < 0)
747 return VM_FAULT_SIGBUS;
748
749 sb_start_pagefault(inode->i_sb);
750
751 if (folio_wait_writeback_killable(folio))
752 goto out;
753
754 if (folio_lock_killable(folio) < 0)
755 goto out;
756
> 757 if (mas_expected_entries(&mas, 2) < 0) {
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-04-22 23:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-22 23:53 [ammarfaizi2-block:dhowells/linux-fs/netfs-maple 37/44] fs/netfs/buffered_write.c:757:6: warning: variable 'spare_region' is used uninitialized whenever 'if' condition is true kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox