All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Zhang Yi <yi.zhang@huaweicloud.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: Re: [PATCH 08/10] ext4: factor out ext4_do_fallocate()
Date: Sat, 31 Aug 2024 21:25:54 +0800	[thread overview]
Message-ID: <202408312146.dOYN7mvc-lkp@intel.com> (raw)
In-Reply-To: <20240830073800.2131781-9-yi.zhang@huaweicloud.com>

Hi Zhang,

kernel test robot noticed the following build warnings:

[auto build test WARNING on tytso-ext4/dev]
[also build test WARNING on linus/master v6.11-rc5 next-20240830]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Zhang-Yi/ext4-write-out-dirty-data-before-dropping-pages/20240830-154319
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
patch link:    https://lore.kernel.org/r/20240830073800.2131781-9-yi.zhang%40huaweicloud.com
patch subject: [PATCH 08/10] ext4: factor out ext4_do_fallocate()
config: i386-buildonly-randconfig-002-20240831 (https://download.01.org/0day-ci/archive/20240831/202408312146.dOYN7mvc-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240831/202408312146.dOYN7mvc-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/202408312146.dOYN7mvc-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> fs/ext4/extents.c:4696:6: warning: variable 'len_lblk' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
    4696 |         if (ret)
         |             ^~~
   fs/ext4/extents.c:4713:43: note: uninitialized use occurs here
    4713 |         trace_ext4_fallocate_exit(inode, offset, len_lblk, ret);
         |                                                  ^~~~~~~~
   fs/ext4/extents.c:4696:2: note: remove the 'if' if its condition is always false
    4696 |         if (ret)
         |         ^~~~~~~~
    4697 |                 goto out;
         |                 ~~~~~~~~
   fs/ext4/extents.c:4688:7: warning: variable 'len_lblk' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
    4688 |                 if (ret)
         |                     ^~~
   fs/ext4/extents.c:4713:43: note: uninitialized use occurs here
    4713 |         trace_ext4_fallocate_exit(inode, offset, len_lblk, ret);
         |                                                  ^~~~~~~~
   fs/ext4/extents.c:4688:3: note: remove the 'if' if its condition is always false
    4688 |                 if (ret)
         |                 ^~~~~~~~
    4689 |                         goto out;
         |                         ~~~~~~~~
   fs/ext4/extents.c:4679:6: warning: variable 'len_lblk' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
    4679 |         if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) {
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ext4/extents.c:4713:43: note: uninitialized use occurs here
    4713 |         trace_ext4_fallocate_exit(inode, offset, len_lblk, ret);
         |                                                  ^~~~~~~~
   fs/ext4/extents.c:4679:2: note: remove the 'if' if its condition is always false
    4679 |         if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) {
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    4680 |                 ret = -EOPNOTSUPP;
         |                 ~~~~~~~~~~~~~~~~~~
    4681 |                 goto out;
         |                 ~~~~~~~~~
    4682 |         }
         |         ~
   fs/ext4/extents.c:4671:34: note: initialize the variable 'len_lblk' to silence this warning
    4671 |         ext4_lblk_t start_lblk, len_lblk;
         |                                         ^
         |                                          = 0
   3 warnings generated.


vim +4696 fs/ext4/extents.c

  4664	
  4665	static long ext4_do_fallocate(struct file *file, loff_t offset,
  4666				      loff_t len, int mode)
  4667	{
  4668		struct inode *inode = file_inode(file);
  4669		loff_t end = offset + len;
  4670		loff_t new_size = 0;
  4671		ext4_lblk_t start_lblk, len_lblk;
  4672		int ret;
  4673	
  4674		trace_ext4_fallocate_enter(inode, offset, len, mode);
  4675	
  4676		inode_lock(inode);
  4677	
  4678		/* We only support preallocation for extent-based files only. */
  4679		if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) {
  4680			ret = -EOPNOTSUPP;
  4681			goto out;
  4682		}
  4683	
  4684		if (!(mode & FALLOC_FL_KEEP_SIZE) &&
  4685		    (end > inode->i_size || end > EXT4_I(inode)->i_disksize)) {
  4686			new_size = end;
  4687			ret = inode_newsize_ok(inode, new_size);
  4688			if (ret)
  4689				goto out;
  4690		}
  4691	
  4692		/* Wait all existing dio workers, newcomers will block on i_rwsem */
  4693		inode_dio_wait(inode);
  4694	
  4695		ret = file_modified(file);
> 4696		if (ret)
  4697			goto out;
  4698	
  4699		start_lblk = offset >> inode->i_blkbits;
  4700		len_lblk = EXT4_MAX_BLOCKS(len, offset, inode->i_blkbits);
  4701	
  4702		ret = ext4_alloc_file_blocks(file, start_lblk, len_lblk, new_size,
  4703					     EXT4_GET_BLOCKS_CREATE_UNWRIT_EXT);
  4704		if (ret)
  4705			goto out;
  4706	
  4707		if (file->f_flags & O_SYNC && EXT4_SB(inode->i_sb)->s_journal) {
  4708			ret = ext4_fc_commit(EXT4_SB(inode->i_sb)->s_journal,
  4709						EXT4_I(inode)->i_sync_tid);
  4710		}
  4711	out:
  4712		inode_unlock(inode);
  4713		trace_ext4_fallocate_exit(inode, offset, len_lblk, ret);
  4714		return ret;
  4715	}
  4716	

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

  reply	other threads:[~2024-08-31 13:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-30  7:37 [PATCH 00/10] ext4: clean up and refactor fallocate Zhang Yi
2024-08-30  7:37 ` [PATCH 01/10] ext4: write out dirty data before dropping pages Zhang Yi
2024-08-30  7:37 ` [PATCH 02/10] ext4: don't explicit update times in ext4_fallocate() Zhang Yi
2024-08-30  7:37 ` [PATCH 03/10] ext4: drop ext4_update_disksize_before_punch() Zhang Yi
2024-08-30  7:37 ` [PATCH 04/10] ext4: refactor ext4_zero_range() Zhang Yi
2024-08-30  7:37 ` [PATCH 05/10] ext4: refactor ext4_punch_hole() Zhang Yi
2024-08-30  7:37 ` [PATCH 06/10] ext4: refactor ext4_collapse_range() Zhang Yi
2024-08-30  7:37 ` [PATCH 07/10] ext4: refactor ext4_insert_range() Zhang Yi
2024-08-30  7:37 ` [PATCH 08/10] ext4: factor out ext4_do_fallocate() Zhang Yi
2024-08-31 13:25   ` kernel test robot [this message]
2024-08-30  7:37 ` [PATCH 09/10] ext4: factor out the common checking part of all fallocate operations Zhang Yi
2024-08-30  7:38 ` [PATCH 10/10] ext4: factor out a common helper to lock and flush data before fallocate Zhang Yi

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=202408312146.dOYN7mvc-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=yi.zhang@huaweicloud.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.