public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Yangtao Li <frank.li@vivo.com>,
	clm@fb.com, josef@toxicpanda.com, dsterba@suse.com
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	Yangtao Li <frank.li@vivo.com>
Subject: Re: [PATCH 2/2] btrfs: convert to mutex guard in btrfs_ioctl_balance_progress()
Date: Thu, 10 Apr 2025 22:45:03 +0800	[thread overview]
Message-ID: <202504102206.gpAU9chA-lkp@intel.com> (raw)
In-Reply-To: <20250409125724.145597-2-frank.li@vivo.com>

Hi Yangtao,

kernel test robot noticed the following build warnings:

[auto build test WARNING on kdave/for-next]
[also build test WARNING on linus/master v6.15-rc1 next-20250410]
[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/Yangtao-Li/btrfs-convert-to-mutex-guard-in-btrfs_ioctl_balance_progress/20250409-204204
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-next
patch link:    https://lore.kernel.org/r/20250409125724.145597-2-frank.li%40vivo.com
patch subject: [PATCH 2/2] btrfs: convert to mutex guard in btrfs_ioctl_balance_progress()
config: arm-randconfig-001-20250410 (https://download.01.org/0day-ci/archive/20250410/202504102206.gpAU9chA-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project f819f46284f2a79790038e1f6649172789734ae8)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250410/202504102206.gpAU9chA-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/202504102206.gpAU9chA-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> fs/btrfs/ioctl.c:3639:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
    3639 |         if (copy_to_user(arg, bargs, sizeof(*bargs)))
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/btrfs/ioctl.c:3644:9: note: uninitialized use occurs here
    3644 |         return ret;
         |                ^~~
   fs/btrfs/ioctl.c:3639:2: note: remove the 'if' if its condition is always true
    3639 |         if (copy_to_user(arg, bargs, sizeof(*bargs)))
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    3640 |                 ret = -EFAULT;
   fs/btrfs/ioctl.c:3623:9: note: initialize the variable 'ret' to silence this warning
    3623 |         int ret;
         |                ^
         |                 = 0
   1 warning generated.


vim +3639 fs/btrfs/ioctl.c

837d5b6e46d1a4 Ilya Dryomov 2012-01-16  3618  
2ff7e61e0d30ff Jeff Mahoney 2016-06-22  3619  static long btrfs_ioctl_balance_progress(struct btrfs_fs_info *fs_info,
19a39dce3b9bf0 Ilya Dryomov 2012-01-16  3620  					 void __user *arg)
19a39dce3b9bf0 Ilya Dryomov 2012-01-16  3621  {
19a39dce3b9bf0 Ilya Dryomov 2012-01-16  3622  	struct btrfs_ioctl_balance_args *bargs;
68395a7bf00486 Yangtao Li   2025-04-09  3623  	int ret;
19a39dce3b9bf0 Ilya Dryomov 2012-01-16  3624  
19a39dce3b9bf0 Ilya Dryomov 2012-01-16  3625  	if (!capable(CAP_SYS_ADMIN))
19a39dce3b9bf0 Ilya Dryomov 2012-01-16  3626  		return -EPERM;
19a39dce3b9bf0 Ilya Dryomov 2012-01-16  3627  
68395a7bf00486 Yangtao Li   2025-04-09  3628  	guard(mutex)(&fs_info->balance_mutex);
68395a7bf00486 Yangtao Li   2025-04-09  3629  
68395a7bf00486 Yangtao Li   2025-04-09  3630  	if (!fs_info->balance_ctl)
68395a7bf00486 Yangtao Li   2025-04-09  3631  		return -ENOTCONN;
19a39dce3b9bf0 Ilya Dryomov 2012-01-16  3632  
8d2db7855e7b65 David Sterba 2015-11-04  3633  	bargs = kzalloc(sizeof(*bargs), GFP_KERNEL);
68395a7bf00486 Yangtao Li   2025-04-09  3634  	if (!bargs)
68395a7bf00486 Yangtao Li   2025-04-09  3635  		return -ENOMEM;
19a39dce3b9bf0 Ilya Dryomov 2012-01-16  3636  
008ef0969dd966 David Sterba 2018-03-21  3637  	btrfs_update_ioctl_balance_args(fs_info, bargs);
19a39dce3b9bf0 Ilya Dryomov 2012-01-16  3638  
19a39dce3b9bf0 Ilya Dryomov 2012-01-16 @3639  	if (copy_to_user(arg, bargs, sizeof(*bargs)))
19a39dce3b9bf0 Ilya Dryomov 2012-01-16  3640  		ret = -EFAULT;
19a39dce3b9bf0 Ilya Dryomov 2012-01-16  3641  
19a39dce3b9bf0 Ilya Dryomov 2012-01-16  3642  	kfree(bargs);
68395a7bf00486 Yangtao Li   2025-04-09  3643  
19a39dce3b9bf0 Ilya Dryomov 2012-01-16  3644  	return ret;
19a39dce3b9bf0 Ilya Dryomov 2012-01-16  3645  }
19a39dce3b9bf0 Ilya Dryomov 2012-01-16  3646  

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

  reply	other threads:[~2025-04-10 14:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-09 12:57 [PATCH 1/2] btrfs: convert to spinlock guards in btrfs_update_ioctl_balance_args() Yangtao Li
2025-04-09 12:57 ` [PATCH 2/2] btrfs: convert to mutex guard in btrfs_ioctl_balance_progress() Yangtao Li
2025-04-10 14:45   ` kernel test robot [this message]
2025-04-09 18:30 ` [PATCH 1/2] btrfs: convert to spinlock guards in btrfs_update_ioctl_balance_args() David Sterba
2025-04-10 11:11   ` 回复: " 李扬韬
2025-04-15 17:53     ` David Sterba
2025-04-17 13:38       ` 回复: " 李扬韬

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=202504102206.gpAU9chA-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=frank.li@vivo.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@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