Re: [bcache:for-next 9/27] drivers/md/bcache/sysfs.c:271 __cached_dev_store() error: uninitialized symbol 'v'.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2018/8/10 4:19 PM, kbuild test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/colyli/linux-bcache.git for-next
> head:   2b04674443471465b4bdc0e52b2355bb5e128078
> commit: 9c26e5fd96446919cc77c14a09ba9b6cf2320ab5 [9/27] bcache: set max writeback rate when I/O request is idle
> 
> smatch warnings:
> drivers/md/bcache/sysfs.c:271 __cached_dev_store() error: uninitialized symbol 'v'.
> 
> # https://git.kernel.org/pub/scm/linux/kernel/git/colyli/linux-bcache.git/commit/?id=9c26e5fd96446919cc77c14a09ba9b6cf2320ab5
> git remote add bcache https://git.kernel.org/pub/scm/linux/kernel/git/colyli/linux-bcache.git
> git remote update bcache
> git checkout 9c26e5fd96446919cc77c14a09ba9b6cf2320ab5
> vim +/v +271 drivers/md/bcache/sysfs.c
> 

Oh, here is a bug, thanks for pointing out this. Very helpful!

Coly Li

> cafe5635 Kent Overstreet     2013-03-23  257  
> cafe5635 Kent Overstreet     2013-03-23  258  	sysfs_strtoul(data_csum,	dc->disk.data_csum);
> cafe5635 Kent Overstreet     2013-03-23  259  	d_strtoul(verify);
> 5ceaaad7 Kent Overstreet     2013-09-10  260  	d_strtoul(bypass_torture_test);
> cafe5635 Kent Overstreet     2013-03-23  261  	d_strtoul(writeback_metadata);
> cafe5635 Kent Overstreet     2013-03-23  262  	d_strtoul(writeback_running);
> cafe5635 Kent Overstreet     2013-03-23  263  	d_strtoul(writeback_delay);
> 16749c23 Kent Overstreet     2013-11-11  264  
> cafe5635 Kent Overstreet     2013-03-23  265  	sysfs_strtoul_clamp(writeback_percent, dc->writeback_percent, 0, 40);
> cafe5635 Kent Overstreet     2013-03-23  266  
> 9c26e5fd Coly Li             2018-07-26  267  	if (attr == &sysfs_writeback_rate) {
> 9c26e5fd Coly Li             2018-07-26  268  		int v;
> 9c26e5fd Coly Li             2018-07-26  269  
> 9c26e5fd Coly Li             2018-07-26  270  		sysfs_strtoul_clamp(writeback_rate, v, 1, INT_MAX);
>                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 9c26e5fd Coly Li             2018-07-26 @271  		atomic_long_set(&dc->writeback_rate.rate, v);
>                                                                                                   ^
> This code is impossible to reach, so Smatch isn't supposed to generate
> a warning...  It doesn't warn when I build it on my system...  Sometimes
> Smatch takes short cuts if the system is overloaded so that might be the
> reason for this warning.
> 
> Anyway, sysfs_strtoul_clamp() returns if "attr == &sysfs_writeback_rate".
> 

[snipped]
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
> 




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux