public inbox for [email protected]
 help / color / mirror / Atom feed
From: kernel test robot <[email protected]>
To: David Howells <[email protected]>
Cc: [email protected], [email protected],
	GNU/Weeb Mailing List <[email protected]>,
	[email protected]
Subject: [ammarfaizi2-block:dhowells/linux-fs/netfs-maple 35/40] fs/netfs/buffered_write.c:757:6: warning: variable 'spare_region' is used uninitialized whenever 'if' condition is true
Date: Tue, 5 Apr 2022 13:40:48 +0800	[thread overview]
Message-ID: <[email protected]> (raw)

tree:   https://github.com/ammarfaizi2/linux-block dhowells/linux-fs/netfs-maple
head:   674eea41fc70a740ff83ec590f9833f805852464
commit: fc20927bc9709523b2a53feee2a52423b9d66456 [35/40] netfs: Allow buffered shared-writeable mmap through netfs_page_mkwrite()
config: x86_64-randconfig-a005 (https://download.01.org/0day-ci/archive/20220405/[email protected]/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project c4a1b07d0979e7ff20d7d541af666d822d66b566)
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/fc20927bc9709523b2a53feee2a52423b9d66456
        git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
        git fetch --no-tags ammarfaizi2-block dhowells/linux-fs/netfs-maple
        git checkout fc20927bc9709523b2a53feee2a52423b9d66456
        # save the config file to linux build tree
        mkdir build_dir
        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

                 reply	other threads:[~2022-04-05  5:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox