From: Dan Carpenter <dan.carpenter@oracle.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 10:29:23 +0300 [thread overview]
Message-ID: <20210129072923.GK2696@kadam> (raw)
[-- 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 --]
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild-all@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 10:29:23 +0300 [thread overview]
Message-ID: <20210129072923.GK2696@kadam> (raw)
[-- 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 --]
next reply other threads:[~2021-01-29 7:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-29 7:29 Dan Carpenter [this message]
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
-- strict thread matches above, loose matches on Subject: below --
2021-01-28 20:00 kernel test robot
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=20210129072923.GK2696@kadam \
--to=dan.carpenter@oracle.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.