Hi Vivek,
url:
https://github.com/0day-ci/linux/commits/Vivek-Goyal/vfs-overlayfs-Fix-sy...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs.git overlayfs-next
config: x86_64-randconfig-m001-20201217 (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(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
fs/overlayfs/super.c:327 ovl_syncfs() error: uninitialized symbol 'ret2'.
vim +/ret2 +327 fs/overlayfs/super.c
d0a04f1c11adc0e Vivek Goyal 2020-12-16 292 int ovl_syncfs(struct file *file)
d0a04f1c11adc0e Vivek Goyal 2020-12-16 293 {
d0a04f1c11adc0e Vivek Goyal 2020-12-16 294 struct super_block *sb =
file->f_path.dentry->d_sb;
d0a04f1c11adc0e Vivek Goyal 2020-12-16 295 struct ovl_fs *ofs = sb->s_fs_info;
d0a04f1c11adc0e Vivek Goyal 2020-12-16 296 struct super_block *upper_sb;
0bed6122e561e0b Vivek Goyal 2020-12-16 297 int ret, ret2;
d0a04f1c11adc0e Vivek Goyal 2020-12-16 298
d0a04f1c11adc0e Vivek Goyal 2020-12-16 299 ret = 0;
d0a04f1c11adc0e Vivek Goyal 2020-12-16 300 down_read(&sb->s_umount);
d0a04f1c11adc0e Vivek Goyal 2020-12-16 301 if (sb_rdonly(sb))
d0a04f1c11adc0e Vivek Goyal 2020-12-16 302 goto out;
^^^^^^^^^
"ret" is zero and "ret2" is uninitialized.
d0a04f1c11adc0e Vivek Goyal 2020-12-16 303
d0a04f1c11adc0e Vivek Goyal 2020-12-16 304 if (!ovl_upper_mnt(ofs))
d0a04f1c11adc0e Vivek Goyal 2020-12-16 305 goto out;
d0a04f1c11adc0e Vivek Goyal 2020-12-16 306
d0a04f1c11adc0e Vivek Goyal 2020-12-16 307 if (!ovl_should_sync(ofs))
d0a04f1c11adc0e Vivek Goyal 2020-12-16 308 goto out;
d0a04f1c11adc0e Vivek Goyal 2020-12-16 309
d0a04f1c11adc0e Vivek Goyal 2020-12-16 310 upper_sb =
ovl_upper_mnt(ofs)->mnt_sb;
d0a04f1c11adc0e Vivek Goyal 2020-12-16 311
d0a04f1c11adc0e Vivek Goyal 2020-12-16 312 down_read(&upper_sb->s_umount);
d0a04f1c11adc0e Vivek Goyal 2020-12-16 313 ret = sync_filesystem(upper_sb);
d0a04f1c11adc0e Vivek Goyal 2020-12-16 314 up_read(&upper_sb->s_umount);
d0a04f1c11adc0e Vivek Goyal 2020-12-16 315
0bed6122e561e0b Vivek Goyal 2020-12-16 316 /* Update overlay sb->s_wb_err */
0bed6122e561e0b Vivek Goyal 2020-12-16 317 if
(errseq_check(&upper_sb->s_wb_err, sb->s_wb_err)) {
0bed6122e561e0b Vivek Goyal 2020-12-16 318 /* Upper sb has errors since last time
*/
0bed6122e561e0b Vivek Goyal 2020-12-16 319 spin_lock(&ofs->errseq_lock);
0bed6122e561e0b Vivek Goyal 2020-12-16 320
errseq_check_and_advance(&upper_sb->s_wb_err, &sb->s_wb_err);
0bed6122e561e0b Vivek Goyal 2020-12-16 321 spin_unlock(&ofs->errseq_lock);
0bed6122e561e0b Vivek Goyal 2020-12-16 322 }
d0a04f1c11adc0e Vivek Goyal 2020-12-16 323
0bed6122e561e0b Vivek Goyal 2020-12-16 324 ret2 =
errseq_check_and_advance(&sb->s_wb_err, &file->f_sb_err);
d0a04f1c11adc0e Vivek Goyal 2020-12-16 325 out:
d0a04f1c11adc0e Vivek Goyal 2020-12-16 326 up_read(&sb->s_umount);
0bed6122e561e0b Vivek Goyal 2020-12-16 @327 return ret ? ret : ret2;
^^^^
So we are returning an uninitialized variable.
d0a04f1c11adc0e Vivek Goyal 2020-12-16 328 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave(a)lists.01.org