From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org
Subject: Re: [PATCH 3/3] overlayfs: Check writeback errors w.r.t upper in ->syncfs()
Date: Sat, 19 Dec 2020 16:49:12 +0300 [thread overview]
Message-ID: <20201219134912.GO2831@kadam> (raw)
In-Reply-To: <20201216233149.39025-4-vgoyal@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 3832 bytes --]
Hi Vivek,
url: https://github.com/0day-ci/linux/commits/Vivek-Goyal/vfs-overlayfs-Fix-syncfs-to-return-error/20201217-073932
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@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@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(a)lists.01.org
_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 32635 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild-all@lists.01.org
Subject: [kbuild] Re: [PATCH 3/3] overlayfs: Check writeback errors w.r.t upper in ->syncfs()
Date: Sat, 19 Dec 2020 16:49:12 +0300 [thread overview]
Message-ID: <20201219134912.GO2831@kadam> (raw)
In-Reply-To: <20201216233149.39025-4-vgoyal@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 3832 bytes --]
Hi Vivek,
url: https://github.com/0day-ci/linux/commits/Vivek-Goyal/vfs-overlayfs-Fix-syncfs-to-return-error/20201217-073932
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@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@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(a)lists.01.org
_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 32635 bytes --]
next prev parent reply other threads:[~2020-12-19 13:49 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-16 23:31 [RFC PATCH 0/3] vfs, overlayfs: Fix syncfs() to return error Vivek Goyal
2020-12-16 23:31 ` [PATCH 1/3] vfs: add new f_op->syncfs vector Vivek Goyal
2020-12-17 0:49 ` Al Viro
2020-12-17 9:57 ` Jan Kara
2020-12-17 16:15 ` Vivek Goyal
2020-12-17 15:00 ` Vivek Goyal
2020-12-17 19:49 ` Jeff Layton
2020-12-16 23:31 ` [PATCH 2/3] overlayfs: Implement f_op->syncfs() call Vivek Goyal
2020-12-16 23:31 ` [PATCH 3/3] overlayfs: Check writeback errors w.r.t upper in ->syncfs() Vivek Goyal
2020-12-17 20:08 ` Jeffrey Layton
2020-12-18 14:44 ` Vivek Goyal
2020-12-18 15:02 ` Jeff Layton
2020-12-18 16:28 ` Vivek Goyal
2020-12-18 16:55 ` Jeffrey Layton
2020-12-18 20:25 ` NeilBrown
2020-12-19 13:49 ` Dan Carpenter [this message]
2020-12-19 13:49 ` [kbuild] " Dan Carpenter
-- strict thread matches above, loose matches on Subject: below --
2020-12-19 5:57 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=20201219134912.GO2831@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.