Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2021-01-05 Thread Amir Goldstein
On Tue, Jan 5, 2021 at 6:26 PM Vivek Goyal wrote: > > On Tue, Jan 05, 2021 at 09:11:23AM +0200, Amir Goldstein wrote: > > > > > > > > What I would rather see is: > > > > - Non-volatile: first syncfs in every container gets an error (nice to > > > > have) > > > > > > I am not sure why are we

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2021-01-05 Thread Vivek Goyal
On Tue, Jan 05, 2021 at 09:11:23AM +0200, Amir Goldstein wrote: > > > > > > What I would rather see is: > > > - Non-volatile: first syncfs in every container gets an error (nice to > > > have) > > > > I am not sure why are we making this behavior per container. This should > > be no different

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2021-01-04 Thread Amir Goldstein
> > > > What I would rather see is: > > - Non-volatile: first syncfs in every container gets an error (nice to have) > > I am not sure why are we making this behavior per container. This should > be no different from current semantics we have for syncfs() on regular > filesystem. And that will

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2021-01-04 Thread Amir Goldstein
On Mon, Jan 4, 2021 at 5:40 PM Vivek Goyal wrote: > > On Mon, Jan 04, 2021 at 05:22:07PM +0200, Amir Goldstein wrote: > > > > Since Jeff's patch is minimal, I think that it should be the fix applied > > > > first and proposed for stable (with adaptations for non-volatile > > > > overlay). > > >

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2021-01-04 Thread Vivek Goyal
On Mon, Jan 04, 2021 at 11:42:51PM +0200, Amir Goldstein wrote: > On Mon, Jan 4, 2021 at 5:40 PM Vivek Goyal wrote: > > > > On Mon, Jan 04, 2021 at 05:22:07PM +0200, Amir Goldstein wrote: > > > > > Since Jeff's patch is minimal, I think that it should be the fix > > > > > applied > > > > > first

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2021-01-04 Thread Vivek Goyal
On Wed, Dec 23, 2020 at 06:20:27PM +, Sargun Dhillon wrote: > On Mon, Dec 21, 2020 at 02:50:55PM -0500, Vivek Goyal wrote: > > Currently syncfs() and fsync() seem to be two interfaces which check and > > return writeback errors on superblock to user space. fsync() should > > work fine with

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2021-01-04 Thread Vivek Goyal
On Mon, Dec 28, 2020 at 03:56:18PM +, Matthew Wilcox wrote: > On Mon, Dec 28, 2020 at 08:25:50AM -0500, Jeff Layton wrote: > > To be clear, the main thing you'll lose with the method above is the > > ability to see an unseen error on a newly opened fd, if there was an > > overlayfs mount using

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2021-01-04 Thread Vivek Goyal
On Mon, Dec 28, 2020 at 05:51:06PM +0200, Amir Goldstein wrote: > On Mon, Dec 28, 2020 at 3:25 PM Jeff Layton wrote: > > > > On Fri, 2020-12-25 at 08:50 +0200, Amir Goldstein wrote: > > > On Thu, Dec 24, 2020 at 2:13 PM Matthew Wilcox > > > wrote: > > > > > > > > On Thu, Dec 24, 2020 at

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2021-01-04 Thread Vivek Goyal
On Mon, Jan 04, 2021 at 05:22:07PM +0200, Amir Goldstein wrote: > > > Since Jeff's patch is minimal, I think that it should be the fix applied > > > first and proposed for stable (with adaptations for non-volatile overlay). > > > > Does stable fix has to be same as mainline fix. IOW, I think

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2021-01-04 Thread Amir Goldstein
> > Since Jeff's patch is minimal, I think that it should be the fix applied > > first and proposed for stable (with adaptations for non-volatile overlay). > > Does stable fix has to be same as mainline fix. IOW, I think atleast in > mainline we should first fix it the right way and then think how

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2021-01-04 Thread Vivek Goyal
On Thu, Dec 24, 2020 at 11:32:55AM +0200, Amir Goldstein wrote: > On Wed, Dec 23, 2020 at 10:44 PM Matthew Wilcox wrote: > > > > On Wed, Dec 23, 2020 at 08:21:41PM +, Sargun Dhillon wrote: > > > On Wed, Dec 23, 2020 at 08:07:46PM +, Matthew Wilcox wrote: > > > > On Wed, Dec 23, 2020 at

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2021-01-02 Thread Jeff Layton
On Mon, 2020-12-28 at 20:48 +, Matthew Wilcox wrote: > On Mon, Dec 28, 2020 at 09:37:37PM +0200, Amir Goldstein wrote: > > Having said that, I never objected to the SEEN flag split. > > I STRONGLY object to the SEEN flag split. I think it is completely > unnecessary and nobody's shown me a

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2020-12-28 Thread Amir Goldstein
On Mon, Dec 28, 2020 at 7:26 PM Jeff Layton wrote: > > On Mon, 2020-12-28 at 15:56 +, Matthew Wilcox wrote: > > On Mon, Dec 28, 2020 at 08:25:50AM -0500, Jeff Layton wrote: > > > To be clear, the main thing you'll lose with the method above is the > > > ability to see an unseen error on a

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2020-12-28 Thread Matthew Wilcox
On Mon, Dec 28, 2020 at 09:37:37PM +0200, Amir Goldstein wrote: > Having said that, I never objected to the SEEN flag split. I STRONGLY object to the SEEN flag split. I think it is completely unnecessary and nobody's shown me a use-case that changes my mind.

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2020-12-28 Thread Sargun Dhillon
On Mon, Dec 28, 2020 at 9:26 AM Jeff Layton wrote: > > On Mon, 2020-12-28 at 15:56 +, Matthew Wilcox wrote: > > On Mon, Dec 28, 2020 at 08:25:50AM -0500, Jeff Layton wrote: > > > To be clear, the main thing you'll lose with the method above is the > > > ability to see an unseen error on a

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2020-12-28 Thread Jeff Layton
On Mon, 2020-12-28 at 15:56 +, Matthew Wilcox wrote: > On Mon, Dec 28, 2020 at 08:25:50AM -0500, Jeff Layton wrote: > > To be clear, the main thing you'll lose with the method above is the > > ability to see an unseen error on a newly opened fd, if there was an > > overlayfs mount using the

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2020-12-28 Thread Matthew Wilcox
On Mon, Dec 28, 2020 at 08:25:50AM -0500, Jeff Layton wrote: > To be clear, the main thing you'll lose with the method above is the > ability to see an unseen error on a newly opened fd, if there was an > overlayfs mount using the same upper sb before your open occurred. > > IOW, consider two

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2020-12-28 Thread Amir Goldstein
On Mon, Dec 28, 2020 at 3:25 PM Jeff Layton wrote: > > On Fri, 2020-12-25 at 08:50 +0200, Amir Goldstein wrote: > > On Thu, Dec 24, 2020 at 2:13 PM Matthew Wilcox wrote: > > > > > > On Thu, Dec 24, 2020 at 11:32:55AM +0200, Amir Goldstein wrote: > > > > In current master, syncfs() on any file by

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2020-12-28 Thread Jeff Layton
On Fri, 2020-12-25 at 08:50 +0200, Amir Goldstein wrote: > On Thu, Dec 24, 2020 at 2:13 PM Matthew Wilcox wrote: > > > > On Thu, Dec 24, 2020 at 11:32:55AM +0200, Amir Goldstein wrote: > > > In current master, syncfs() on any file by any container user will > > > result in full syncfs() of the

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2020-12-24 Thread Amir Goldstein
On Thu, Dec 24, 2020 at 2:13 PM Matthew Wilcox wrote: > > On Thu, Dec 24, 2020 at 11:32:55AM +0200, Amir Goldstein wrote: > > In current master, syncfs() on any file by any container user will > > result in full syncfs() of the upperfs, which is very bad for container > > isolation. This has been

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2020-12-24 Thread Matthew Wilcox
On Thu, Dec 24, 2020 at 11:32:55AM +0200, Amir Goldstein wrote: > In current master, syncfs() on any file by any container user will > result in full syncfs() of the upperfs, which is very bad for container > isolation. This has been partly fixed by Chengguang Xu [1] and I expect > his work will

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2020-12-24 Thread Sargun Dhillon
On Thu, Dec 24, 2020 at 11:32:55AM +0200, Amir Goldstein wrote: > On Wed, Dec 23, 2020 at 10:44 PM Matthew Wilcox wrote: > > > > On Wed, Dec 23, 2020 at 08:21:41PM +, Sargun Dhillon wrote: > > > On Wed, Dec 23, 2020 at 08:07:46PM +, Matthew Wilcox wrote: > > > > On Wed, Dec 23, 2020 at

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2020-12-24 Thread Amir Goldstein
On Wed, Dec 23, 2020 at 10:44 PM Matthew Wilcox wrote: > > On Wed, Dec 23, 2020 at 08:21:41PM +, Sargun Dhillon wrote: > > On Wed, Dec 23, 2020 at 08:07:46PM +, Matthew Wilcox wrote: > > > On Wed, Dec 23, 2020 at 07:29:41PM +, Sargun Dhillon wrote: > > > > On Wed, Dec 23, 2020 at

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2020-12-23 Thread Matthew Wilcox
On Wed, Dec 23, 2020 at 08:21:41PM +, Sargun Dhillon wrote: > On Wed, Dec 23, 2020 at 08:07:46PM +, Matthew Wilcox wrote: > > On Wed, Dec 23, 2020 at 07:29:41PM +, Sargun Dhillon wrote: > > > On Wed, Dec 23, 2020 at 06:50:44PM +, Matthew Wilcox wrote: > > > > On Wed, Dec 23, 2020

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2020-12-23 Thread Sargun Dhillon
On Wed, Dec 23, 2020 at 08:07:46PM +, Matthew Wilcox wrote: > On Wed, Dec 23, 2020 at 07:29:41PM +, Sargun Dhillon wrote: > > On Wed, Dec 23, 2020 at 06:50:44PM +, Matthew Wilcox wrote: > > > On Wed, Dec 23, 2020 at 06:20:27PM +, Sargun Dhillon wrote: > > > > I fail to see why this

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2020-12-23 Thread Matthew Wilcox
On Wed, Dec 23, 2020 at 07:29:41PM +, Sargun Dhillon wrote: > On Wed, Dec 23, 2020 at 06:50:44PM +, Matthew Wilcox wrote: > > On Wed, Dec 23, 2020 at 06:20:27PM +, Sargun Dhillon wrote: > > > I fail to see why this is neccessary if you incorporate error reporting > > > into the > > >

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2020-12-23 Thread Sargun Dhillon
On Wed, Dec 23, 2020 at 06:50:44PM +, Matthew Wilcox wrote: > On Wed, Dec 23, 2020 at 06:20:27PM +, Sargun Dhillon wrote: > > I fail to see why this is neccessary if you incorporate error reporting > > into the > > sync_fs callback. Why is this separate from that callback? If you pickup

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2020-12-23 Thread Jeff Layton
On Wed, 2020-12-23 at 18:20 +, Sargun Dhillon wrote: > On Mon, Dec 21, 2020 at 02:50:55PM -0500, Vivek Goyal wrote: > > Currently syncfs() and fsync() seem to be two interfaces which check and > > return writeback errors on superblock to user space. fsync() should > > work fine with overlayfs

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2020-12-23 Thread Matthew Wilcox
On Wed, Dec 23, 2020 at 06:20:27PM +, Sargun Dhillon wrote: > I fail to see why this is neccessary if you incorporate error reporting into > the > sync_fs callback. Why is this separate from that callback? If you pickup > Jeff's > patch that adds the 2nd flag to errseq for "observed", you

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2020-12-23 Thread Sargun Dhillon
On Mon, Dec 21, 2020 at 02:50:55PM -0500, Vivek Goyal wrote: > Currently syncfs() and fsync() seem to be two interfaces which check and > return writeback errors on superblock to user space. fsync() should > work fine with overlayfs as it relies on underlying filesystem to > do the check and

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2020-12-23 Thread Jeff Layton
On Tue, 2020-12-22 at 12:55 -0500, Vivek Goyal wrote: > On Tue, Dec 22, 2020 at 05:46:37PM +, Matthew Wilcox wrote: > > On Tue, Dec 22, 2020 at 11:29:25AM -0500, Vivek Goyal wrote: > > > On Tue, Dec 22, 2020 at 04:20:27PM +, Matthew Wilcox wrote: > > > > On Mon, Dec 21, 2020 at 02:50:55PM

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2020-12-22 Thread Vivek Goyal
On Tue, Dec 22, 2020 at 05:46:37PM +, Matthew Wilcox wrote: > On Tue, Dec 22, 2020 at 11:29:25AM -0500, Vivek Goyal wrote: > > On Tue, Dec 22, 2020 at 04:20:27PM +, Matthew Wilcox wrote: > > > On Mon, Dec 21, 2020 at 02:50:55PM -0500, Vivek Goyal wrote: > > > > +static int

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2020-12-22 Thread Matthew Wilcox
On Tue, Dec 22, 2020 at 11:29:25AM -0500, Vivek Goyal wrote: > On Tue, Dec 22, 2020 at 04:20:27PM +, Matthew Wilcox wrote: > > On Mon, Dec 21, 2020 at 02:50:55PM -0500, Vivek Goyal wrote: > > > +static int ovl_errseq_check_advance(struct super_block *sb, struct file > > > *file) > > > +{ > >

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2020-12-22 Thread Vivek Goyal
On Tue, Dec 22, 2020 at 04:20:27PM +, Matthew Wilcox wrote: > On Mon, Dec 21, 2020 at 02:50:55PM -0500, Vivek Goyal wrote: > > +static int ovl_errseq_check_advance(struct super_block *sb, struct file > > *file) > > +{ > > + struct ovl_fs *ofs = sb->s_fs_info; > > + struct super_block

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2020-12-22 Thread Matthew Wilcox
On Mon, Dec 21, 2020 at 02:50:55PM -0500, Vivek Goyal wrote: > +static int ovl_errseq_check_advance(struct super_block *sb, struct file > *file) > +{ > + struct ovl_fs *ofs = sb->s_fs_info; > + struct super_block *upper_sb; > + int ret; > + > + if (!ovl_upper_mnt(ofs)) > +

[PATCH 3/3] overlayfs: Report writeback errors on upper

2020-12-21 Thread Vivek Goyal
Currently syncfs() and fsync() seem to be two interfaces which check and return writeback errors on superblock to user space. fsync() should work fine with overlayfs as it relies on underlying filesystem to do the check and return error. For example, if ext4 is on upper filesystem, then