All of lore.kernel.org
 help / color / mirror / Atom feed
* [kdave-btrfs-devel:dev/raid-policy 82/85] fs/btrfs/volumes.c:5606 find_live_mirror_load() error: uninitialized symbol 'now'.
@ 2021-01-29  7:29 ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2021-01-29  7:29 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://github.com/kdave/btrfs-devel.git dev/raid-policy
head:   cdf61a56c20bf9881f8cac47eabe3adea5fc23a9
commit: e3953975b6a7b35788f3141689f2745e8200438d [82/85] btrfs: Add load read policy
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)

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

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  	}

now not initialized on else path.

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  }

---
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 --]

^ permalink raw reply	[flat|nested] 3+ messages in thread
* [kdave-btrfs-devel:dev/raid-policy 82/85] fs/btrfs/volumes.c:5606 find_live_mirror_load() error: uninitialized symbol 'now'.
@ 2021-01-28 20:00 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2021-01-28 20:00 UTC (permalink / raw)
  To: kbuild

[-- 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 --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-29  7:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
  -- strict thread matches above, loose matches on Subject: below --
2021-01-28 20:00 kernel test robot

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.