All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [kdave-btrfs-devel:dev/raid-policy 82/85] fs/btrfs/volumes.c:5606 find_live_mirror_load() error: uninitialized symbol 'now'.
Date: Fri, 29 Jan 2021 04:00:25 +0800	[thread overview]
Message-ID: <202101290419.heph18Fj-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4176 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Michal Rostecki <mrostecki@suse.com>
CC: David Sterba <dsterba@suse.com>

tree:   https://github.com/kdave/btrfs-devel.git dev/raid-policy
head:   cdf61a56c20bf9881f8cac47eabe3adea5fc23a9
commit: e3953975b6a7b35788f3141689f2745e8200438d [82/85] btrfs: Add load read policy
:::::: branch date: 4 hours ago
:::::: commit date: 6 hours ago
config: i386-randconfig-m021-20210128 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
fs/btrfs/volumes.c:5606 find_live_mirror_load() error: uninitialized symbol 'now'.

Old smatch warnings:
fs/btrfs/volumes.c:1235 open_fs_devices() error: we previously assumed 'latest_dev' could be null (see line 1223)
fs/btrfs/volumes.h:215 btrfs_device_set_total_bytes() warn: statement has no effect 31
fs/btrfs/volumes.h:216 btrfs_device_set_disk_total_bytes() warn: statement has no effect 31
fs/btrfs/volumes.h:217 btrfs_device_set_bytes_used() warn: statement has no effect 31

vim +/now +5606 fs/btrfs/volumes.c

e3953975b6a7b3 Michal Rostecki 2021-01-22  5572  
e3953975b6a7b3 Michal Rostecki 2021-01-22  5573  static int find_live_mirror_load(struct btrfs_fs_info *fs_info,
e3953975b6a7b3 Michal Rostecki 2021-01-22  5574  				 struct map_lookup *map, int first,
e3953975b6a7b3 Michal Rostecki 2021-01-22  5575  				 int num_stripes)
e3953975b6a7b3 Michal Rostecki 2021-01-22  5576  {
e3953975b6a7b3 Michal Rostecki 2021-01-22  5577  	int preferred_mirror;
e3953975b6a7b3 Michal Rostecki 2021-01-22  5578  	u64 last_sched_time;
e3953975b6a7b3 Michal Rostecki 2021-01-22  5579  	int min_load;
e3953975b6a7b3 Michal Rostecki 2021-01-22  5580  	int cur_load;
e3953975b6a7b3 Michal Rostecki 2021-01-22  5581  	u64 duration;
e3953975b6a7b3 Michal Rostecki 2021-01-22  5582  	u64 now;
e3953975b6a7b3 Michal Rostecki 2021-01-22  5583  	int i;
e3953975b6a7b3 Michal Rostecki 2021-01-22  5584  
e3953975b6a7b3 Michal Rostecki 2021-01-22  5585  	last_sched_time = this_cpu_read(*fs_info->last_sched_time);
e3953975b6a7b3 Michal Rostecki 2021-01-22  5586  	if (last_sched_time != 0) {
e3953975b6a7b3 Michal Rostecki 2021-01-22  5587  		now = ktime_get_ns();
e3953975b6a7b3 Michal Rostecki 2021-01-22  5588  		duration = now - last_sched_time;
e3953975b6a7b3 Michal Rostecki 2021-01-22  5589  
e3953975b6a7b3 Michal Rostecki 2021-01-22  5590  		if (duration < (NSEC_PER_MSEC *
e3953975b6a7b3 Michal Rostecki 2021-01-22  5591  				fs_info->fs_devices->read_policy_load_duration))
e3953975b6a7b3 Michal Rostecki 2021-01-22  5592  			return this_cpu_read(*fs_info->last_mirror);
e3953975b6a7b3 Michal Rostecki 2021-01-22  5593  	}
e3953975b6a7b3 Michal Rostecki 2021-01-22  5594  
e3953975b6a7b3 Michal Rostecki 2021-01-22  5595  	preferred_mirror = first;
e3953975b6a7b3 Michal Rostecki 2021-01-22  5596  	min_load = INT_MAX;
e3953975b6a7b3 Michal Rostecki 2021-01-22  5597  
e3953975b6a7b3 Michal Rostecki 2021-01-22  5598  	for (i = first; i < first + num_stripes; i++) {
e3953975b6a7b3 Michal Rostecki 2021-01-22  5599  		cur_load = mirror_load(fs_info, &map->stripes[i]);
e3953975b6a7b3 Michal Rostecki 2021-01-22  5600  		if (cur_load < min_load) {
e3953975b6a7b3 Michal Rostecki 2021-01-22  5601  			preferred_mirror = i;
e3953975b6a7b3 Michal Rostecki 2021-01-22  5602  			min_load = cur_load;
e3953975b6a7b3 Michal Rostecki 2021-01-22  5603  		}
e3953975b6a7b3 Michal Rostecki 2021-01-22  5604  	}
e3953975b6a7b3 Michal Rostecki 2021-01-22  5605  
e3953975b6a7b3 Michal Rostecki 2021-01-22 @5606  	this_cpu_write(*fs_info->last_sched_time, now);
e3953975b6a7b3 Michal Rostecki 2021-01-22  5607  	this_cpu_write(*fs_info->last_mirror, preferred_mirror);
e3953975b6a7b3 Michal Rostecki 2021-01-22  5608  	return preferred_mirror;
e3953975b6a7b3 Michal Rostecki 2021-01-22  5609  }
e3953975b6a7b3 Michal Rostecki 2021-01-22  5610  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 34410 bytes --]

             reply	other threads:[~2021-01-28 20:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-28 20:00 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-01-29  7:29 [kdave-btrfs-devel:dev/raid-policy 82/85] fs/btrfs/volumes.c:5606 find_live_mirror_load() error: uninitialized symbol 'now' Dan Carpenter
2021-01-29  7:29 ` Dan Carpenter

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=202101290419.heph18Fj-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /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.