public inbox for ntfs3@lists.linux.dev
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	ntfs3@lists.linux.dev
Subject: [paragon-software-group-ntfs3:master 16/16] fs/ntfs3/inode.c:1021:6: warning: variable 'folio' is used uninitialized whenever 'if' condition is true
Date: Thu, 01 Jan 2026 04:12:04 +0800	[thread overview]
Message-ID: <202601010644.FIhOXy6Y-lkp@intel.com> (raw)

tree:   https://github.com/Paragon-Software-Group/linux-ntfs3.git master
head:   099ef9ab9203dff327f2d61e44773f9acbc01f13
commit: 099ef9ab9203dff327f2d61e44773f9acbc01f13 [16/16] fs/ntfs3: implement iomap-based file operations
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20260101/202601010644.FIhOXy6Y-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260101/202601010644.FIhOXy6Y-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202601010644.FIhOXy6Y-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> fs/ntfs3/inode.c:1021:6: warning: variable 'folio' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
    1021 |         if (is_resident(ni)) {
         |             ^~~~~~~~~~~~~~~
   fs/ntfs3/inode.c:1024:48: note: uninitialized use occurs here
    1024 |                 while ((folio = writeback_iter(mapping, wbc, folio, &err)))
         |                                                              ^~~~~
   fs/ntfs3/inode.c:1021:2: note: remove the 'if' if its condition is always false
    1021 |         if (is_resident(ni)) {
         |         ^~~~~~~~~~~~~~~~~~~~~~
    1022 |                 struct folio *folio;
         |                 ~~~~~~~~~~~~~~~~~~~~
    1023 | 
    1024 |                 while ((folio = writeback_iter(mapping, wbc, folio, &err)))
         |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1025 |                         err = ntfs_resident_writepage(folio, wbc);
         |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1026 | 
    1027 |                 return err;
         |                 ~~~~~~~~~~~
    1028 |         }
         |         ~
   fs/ntfs3/inode.c:1022:22: note: initialize the variable 'folio' to silence this warning
    1022 |                 struct folio *folio;
         |                                    ^
         |                                     = NULL
   1 warning generated.


vim +1021 fs/ntfs3/inode.c

  1001	
  1002	static int ntfs_writepages(struct address_space *mapping,
  1003				   struct writeback_control *wbc)
  1004	{
  1005		int err;
  1006		struct inode *inode = mapping->host;
  1007		struct ntfs_inode *ni = ntfs_i(inode);
  1008		struct iomap_writepage_ctx wpc = {
  1009			.inode = mapping->host,
  1010			.wbc = wbc,
  1011			.ops = &ntfs_writeback_ops,
  1012		};
  1013	
  1014		/* Avoid any operation if inode is bad. */
  1015		if (unlikely(is_bad_ni(ni)))
  1016			return -EINVAL;
  1017	
  1018		if (unlikely(ntfs3_forced_shutdown(inode->i_sb)))
  1019			return -EIO;
  1020	
> 1021		if (is_resident(ni)) {
  1022			struct folio *folio;
  1023	
  1024			while ((folio = writeback_iter(mapping, wbc, folio, &err)))
  1025				err = ntfs_resident_writepage(folio, wbc);
  1026	
  1027			return err;
  1028		}
  1029	
  1030		return iomap_writepages(&wpc);
  1031	}
  1032	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2025-12-31 20:12 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 \
    --in-reply-to=202601010644.FIhOXy6Y-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=almaz.alexandrovich@paragon-software.com \
    --cc=llvm@lists.linux.dev \
    --cc=ntfs3@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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