All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] errseq+overlayfs: accomodate the volatile upper layer use-case
@ 2020-12-13 13:27 Jeff Layton
  2020-12-13 13:27 ` [RFC PATCH 1/2] errseq: split the SEEN flag into two new flags Jeff Layton
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Jeff Layton @ 2020-12-13 13:27 UTC (permalink / raw)
  To: Amir Goldstein, Sargun Dhillon
  Cc: Miklos Szeredi, Vivek Goyal, overlayfs,
	Linux FS-devel Mailing List, Matthew Wilcox, NeilBrown, Jan Kara

What about this as an alternate approach to the problem that Sargun has
been working on? I have some minor concerns about the complexity of
managing a stateful object across two different words. That can be
done, but I think this may be simpler.

This set steals an extra flag bit from the errseq_t counter so that we
have two flags: one indicating whether to increment the counter at set
time, and another to indicate whether the error has been reported to
userland.

This should give you the semantics you want in the syncfs case, no?  If
this does look like it's a suitable approach, then I'll plan to clean up
the comments and docs.

I have a vague feeling that this might help us eventually kill the
AS_EIO and AS_ENOSPC bits too, but that would require a bit more work to
plumb in "since" samples at appropriate places.

Jeff Layton (2):
  errseq: split the SEEN flag into two new flags
  overlayfs: propagate errors from upper to overlay sb in sync_fs

 fs/overlayfs/ovl_entry.h |  1 +
 fs/overlayfs/super.c     | 14 +++++++--
 include/linux/errseq.h   |  2 ++
 lib/errseq.c             | 64 +++++++++++++++++++++++++++++++++-------
 4 files changed, 67 insertions(+), 14 deletions(-)

-- 
2.29.2


^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: [RFC PATCH 2/2] overlayfs: propagate errors from upper to overlay sb in sync_fs
@ 2020-12-13 16:38 kernel test robot
  0 siblings, 0 replies; 22+ messages in thread
From: kernel test robot @ 2020-12-13 16:38 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20201213132713.66864-3-jlayton@kernel.org>
References: <20201213132713.66864-3-jlayton@kernel.org>
TO: Jeff Layton <jlayton@kernel.org>

Hi Jeff,

[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on miklos-vfs/overlayfs-next]
[also build test WARNING on linus/master v5.10-rc7 next-20201211]
[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/Jeff-Layton/errseq-overlayfs-accomodate-the-volatile-upper-layer-use-case/20201213-213109
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs.git overlayfs-next
:::::: branch date: 3 hours ago
:::::: commit date: 3 hours ago
config: i386-randconfig-m021-20201213 (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:272 ovl_sync_fs() error: uninitialized symbol 'upper_sb'.

vim +/upper_sb +272 fs/overlayfs/super.c

a9075cdb467dd3b Miklos Szeredi        2017-11-10  259  
e8d4bfe3a715372 Chengguang Xu         2017-11-29  260  /* Sync real dirty inodes in upper filesystem (if it exists) */
e593b2bf513dd4d Amir Goldstein        2017-01-23  261  static int ovl_sync_fs(struct super_block *sb, int wait)
e593b2bf513dd4d Amir Goldstein        2017-01-23  262  {
ad204488d3046b3 Miklos Szeredi        2017-11-10  263  	struct ovl_fs *ofs = sb->s_fs_info;
e593b2bf513dd4d Amir Goldstein        2017-01-23  264  	struct super_block *upper_sb;
e593b2bf513dd4d Amir Goldstein        2017-01-23  265  	int ret;
e593b2bf513dd4d Amir Goldstein        2017-01-23  266  
08f4c7c86d4cf12 Miklos Szeredi        2020-06-04  267  	if (!ovl_upper_mnt(ofs))
e593b2bf513dd4d Amir Goldstein        2017-01-23  268  		return 0;
e8d4bfe3a715372 Chengguang Xu         2017-11-29  269  
89bd90a6b2a9bc4 Jeff Layton           2020-12-13  270  	if (!ovl_should_sync(ofs)) {
89bd90a6b2a9bc4 Jeff Layton           2020-12-13  271  		/* Propagate errors from upper to overlayfs */
89bd90a6b2a9bc4 Jeff Layton           2020-12-13 @272  		ret = errseq_check(&upper_sb->s_wb_err, ofs->err_mark);
89bd90a6b2a9bc4 Jeff Layton           2020-12-13  273  		errseq_set(&sb->s_wb_err, ret);
89bd90a6b2a9bc4 Jeff Layton           2020-12-13  274  		return ret;
89bd90a6b2a9bc4 Jeff Layton           2020-12-13  275  	}
89bd90a6b2a9bc4 Jeff Layton           2020-12-13  276  
e8d4bfe3a715372 Chengguang Xu         2017-11-29  277  	/*
32b1924b210a70d Konstantin Khlebnikov 2020-04-09  278  	 * Not called for sync(2) call or an emergency sync (SB_I_SKIP_SYNC).
32b1924b210a70d Konstantin Khlebnikov 2020-04-09  279  	 * All the super blocks will be iterated, including upper_sb.
e8d4bfe3a715372 Chengguang Xu         2017-11-29  280  	 *
e8d4bfe3a715372 Chengguang Xu         2017-11-29  281  	 * If this is a syncfs(2) call, then we do need to call
e8d4bfe3a715372 Chengguang Xu         2017-11-29  282  	 * sync_filesystem() on upper_sb, but enough if we do it when being
e8d4bfe3a715372 Chengguang Xu         2017-11-29  283  	 * called with wait == 1.
e8d4bfe3a715372 Chengguang Xu         2017-11-29  284  	 */
e8d4bfe3a715372 Chengguang Xu         2017-11-29  285  	if (!wait)
e593b2bf513dd4d Amir Goldstein        2017-01-23  286  		return 0;
e593b2bf513dd4d Amir Goldstein        2017-01-23  287  
08f4c7c86d4cf12 Miklos Szeredi        2020-06-04  288  	upper_sb = ovl_upper_mnt(ofs)->mnt_sb;
e8d4bfe3a715372 Chengguang Xu         2017-11-29  289  
e593b2bf513dd4d Amir Goldstein        2017-01-23  290  	down_read(&upper_sb->s_umount);
e8d4bfe3a715372 Chengguang Xu         2017-11-29  291  	ret = sync_filesystem(upper_sb);
e593b2bf513dd4d Amir Goldstein        2017-01-23  292  	up_read(&upper_sb->s_umount);
e8d4bfe3a715372 Chengguang Xu         2017-11-29  293  
e593b2bf513dd4d Amir Goldstein        2017-01-23  294  	return ret;
e593b2bf513dd4d Amir Goldstein        2017-01-23  295  }
e593b2bf513dd4d Amir Goldstein        2017-01-23  296  

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

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

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

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-13 13:27 [RFC PATCH 0/2] errseq+overlayfs: accomodate the volatile upper layer use-case Jeff Layton
2020-12-13 13:27 ` [RFC PATCH 1/2] errseq: split the SEEN flag into two new flags Jeff Layton
2020-12-13 23:35   ` NeilBrown
2020-12-14 13:37     ` Jeffrey Layton
2020-12-14 22:00       ` NeilBrown
2020-12-14 23:32         ` Jeff Layton
2020-12-13 13:27 ` [RFC PATCH 2/2] overlayfs: propagate errors from upper to overlay sb in sync_fs Jeff Layton
2020-12-13 17:02   ` kernel test robot
2020-12-14  9:14   ` Dan Carpenter
2020-12-14  9:14     ` [kbuild] " Dan Carpenter
2020-12-14 21:38   ` Vivek Goyal
2020-12-14 22:04     ` Sargun Dhillon
2020-12-14 23:01       ` Vivek Goyal
2020-12-14 23:53     ` Jeff Layton
2020-12-15 13:16       ` Jeff Layton
2020-12-15 14:59         ` Vivek Goyal
2020-12-15 15:23           ` Jeff Layton
2020-12-15 15:39             ` Vivek Goyal
2020-12-15 15:06       ` Vivek Goyal
2020-12-17 19:28   ` Sargun Dhillon
2020-12-13 20:31 ` [RFC PATCH 0/2] errseq+overlayfs: accomodate the volatile upper layer use-case Sargun Dhillon
  -- strict thread matches above, loose matches on Subject: below --
2020-12-13 16:38 [RFC PATCH 2/2] overlayfs: propagate errors from upper to overlay sb in sync_fs 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.