All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/3] vfs, overlayfs: Fix syncfs() to return error
@ 2020-12-16 23:31 Vivek Goyal
  2020-12-16 23:31 ` [PATCH 1/3] vfs: add new f_op->syncfs vector Vivek Goyal
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Vivek Goyal @ 2020-12-16 23:31 UTC (permalink / raw)
  To: linux-fsdevel, linux-kernel, linux-unionfs
  Cc: jlayton, vgoyal, amir73il, sargun, miklos, willy, jack, neilb, viro

Hi,

This is V2 of patches which tries to fix syncfs() for overlayfs to
return error code when sync_filesystem(upper_sb) returns error or
there are writeback errors on upper_sb.

I posted V1 of patch here.

https://lore.kernel.org/linux-fsdevel/20201216143802.GA10550@redhat.com/

This is just compile tested patch series. Trying to get early feedback
to figure out what direction to move in to fix this issue. 

Thanks
Vivek

Vivek Goyal (3):
  vfs: add new f_op->syncfs vector
  overlayfs: Implement f_op->syncfs() call
  overlayfs: Check writeback errors w.r.t upper in ->syncfs()

 fs/overlayfs/file.c      |  1 +
 fs/overlayfs/overlayfs.h |  3 +++
 fs/overlayfs/ovl_entry.h |  2 ++
 fs/overlayfs/readdir.c   |  1 +
 fs/overlayfs/super.c     | 41 +++++++++++++++++++++++++++++++++++++++-
 fs/sync.c                | 29 +++++++++++++++++++---------
 include/linux/fs.h       |  1 +
 7 files changed, 68 insertions(+), 10 deletions(-)

-- 
2.25.4


^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: [PATCH 3/3] overlayfs: Check writeback errors w.r.t upper in ->syncfs()
@ 2020-12-19  5:57 kernel test robot
  0 siblings, 0 replies; 18+ messages in thread
From: kernel test robot @ 2020-12-19  5:57 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20201216233149.39025-4-vgoyal@redhat.com>
References: <20201216233149.39025-4-vgoyal@redhat.com>
TO: Vivek Goyal <vgoyal@redhat.com>

Hi Vivek,

I love your patch! Perhaps something to improve:

[auto build test WARNING on miklos-vfs/overlayfs-next]
[also build test WARNING on vfs/for-next linux/master linus/master v5.10 next-20201218]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

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
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
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

e593b2bf513dd4d Amir Goldstein 2017-01-23  291  
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;
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;
d0a04f1c11adc0e Vivek Goyal    2020-12-16  328  }
d0a04f1c11adc0e Vivek Goyal    2020-12-16  329  

---
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: 32635 bytes --]

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

end of thread, other threads:[~2020-12-19 13:49 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2020-12-19 13:49     ` [kbuild] " Dan Carpenter
2020-12-19  5:57 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.