Re: [POC/RFC PATCH] overlayfs: fix data inconsistency at copy up

2016-10-24 Thread Miklos Szeredi
On Sat, Oct 22, 2016 at 5:39 PM, Amir Goldstein wrote: > On Sat, Oct 22, 2016 at 10:24 AM, Amir Goldstein wrote: >> On Fri, Oct 21, 2016 at 11:13 PM, Vivek Goyal wrote: >>> --- >>> fs/file.c| 41

Re: [POC/RFC PATCH] overlayfs: fix data inconsistency at copy up

2016-10-24 Thread Miklos Szeredi
On Sat, Oct 22, 2016 at 5:39 PM, Amir Goldstein wrote: > On Sat, Oct 22, 2016 at 10:24 AM, Amir Goldstein wrote: >> On Fri, Oct 21, 2016 at 11:13 PM, Vivek Goyal wrote: >>> --- >>> fs/file.c| 41 + >>> fs/overlayfs/inode.c |1 + >>> 2

Re: [POC/RFC PATCH] overlayfs: fix data inconsistency at copy up

2016-10-22 Thread Amir Goldstein
On Sat, Oct 22, 2016 at 10:24 AM, Amir Goldstein wrote: > On Fri, Oct 21, 2016 at 11:13 PM, Vivek Goyal wrote: >> On Fri, Oct 21, 2016 at 11:53:41AM +0300, Amir Goldstein wrote: >>> On Thu, Oct 20, 2016 at 11:54 PM, Vivek Goyal wrote:

Re: [POC/RFC PATCH] overlayfs: fix data inconsistency at copy up

2016-10-22 Thread Amir Goldstein
On Sat, Oct 22, 2016 at 10:24 AM, Amir Goldstein wrote: > On Fri, Oct 21, 2016 at 11:13 PM, Vivek Goyal wrote: >> On Fri, Oct 21, 2016 at 11:53:41AM +0300, Amir Goldstein wrote: >>> On Thu, Oct 20, 2016 at 11:54 PM, Vivek Goyal wrote: >>> > On Thu, Oct 20, 2016 at 04:46:30PM -0400, Vivek Goyal

Re: [POC/RFC PATCH] overlayfs: fix data inconsistency at copy up

2016-10-22 Thread Amir Goldstein
On Fri, Oct 21, 2016 at 11:13 PM, Vivek Goyal wrote: > On Fri, Oct 21, 2016 at 11:53:41AM +0300, Amir Goldstein wrote: >> On Thu, Oct 20, 2016 at 11:54 PM, Vivek Goyal wrote: >> > On Thu, Oct 20, 2016 at 04:46:30PM -0400, Vivek Goyal wrote: >> > >> > [..] >>

Re: [POC/RFC PATCH] overlayfs: fix data inconsistency at copy up

2016-10-22 Thread Amir Goldstein
On Fri, Oct 21, 2016 at 11:13 PM, Vivek Goyal wrote: > On Fri, Oct 21, 2016 at 11:53:41AM +0300, Amir Goldstein wrote: >> On Thu, Oct 20, 2016 at 11:54 PM, Vivek Goyal wrote: >> > On Thu, Oct 20, 2016 at 04:46:30PM -0400, Vivek Goyal wrote: >> > >> > [..] >> >> > +static ssize_t

Re: [POC/RFC PATCH] overlayfs: fix data inconsistency at copy up

2016-10-21 Thread Vivek Goyal
On Fri, Oct 21, 2016 at 11:53:41AM +0300, Amir Goldstein wrote: > On Thu, Oct 20, 2016 at 11:54 PM, Vivek Goyal wrote: > > On Thu, Oct 20, 2016 at 04:46:30PM -0400, Vivek Goyal wrote: > > > > [..] > >> > +static ssize_t ovl_read_iter(struct kiocb *iocb, struct iov_iter *to) >

Re: [POC/RFC PATCH] overlayfs: fix data inconsistency at copy up

2016-10-21 Thread Vivek Goyal
On Fri, Oct 21, 2016 at 11:53:41AM +0300, Amir Goldstein wrote: > On Thu, Oct 20, 2016 at 11:54 PM, Vivek Goyal wrote: > > On Thu, Oct 20, 2016 at 04:46:30PM -0400, Vivek Goyal wrote: > > > > [..] > >> > +static ssize_t ovl_read_iter(struct kiocb *iocb, struct iov_iter *to) > >> > +{ > >> > +

Re: [POC/RFC PATCH] overlayfs: fix data inconsistency at copy up

2016-10-21 Thread Vivek Goyal
On Fri, Oct 21, 2016 at 11:12:11AM +0200, Miklos Szeredi wrote: > On Thu, Oct 20, 2016 at 04:54:08PM -0400, Vivek Goyal wrote: > > On Thu, Oct 20, 2016 at 04:46:30PM -0400, Vivek Goyal wrote: > > > > [..] > > > > +static ssize_t ovl_read_iter(struct kiocb *iocb, struct iov_iter *to) > > > > +{ >

Re: [POC/RFC PATCH] overlayfs: fix data inconsistency at copy up

2016-10-21 Thread Vivek Goyal
On Fri, Oct 21, 2016 at 11:12:11AM +0200, Miklos Szeredi wrote: > On Thu, Oct 20, 2016 at 04:54:08PM -0400, Vivek Goyal wrote: > > On Thu, Oct 20, 2016 at 04:46:30PM -0400, Vivek Goyal wrote: > > > > [..] > > > > +static ssize_t ovl_read_iter(struct kiocb *iocb, struct iov_iter *to) > > > > +{ >

Re: [POC/RFC PATCH] overlayfs: fix data inconsistency at copy up

2016-10-21 Thread Amir Goldstein
On Fri, Oct 21, 2016 at 12:30 PM, Miklos Szeredi wrote: > On Fri, Oct 21, 2016 at 11:13 AM, Amir Goldstein wrote: > >> I think it would be a good idea in general to stabilize the overlay ino/dev >> throughout copy-up, same as Miklos suggested to do for

Re: [POC/RFC PATCH] overlayfs: fix data inconsistency at copy up

2016-10-21 Thread Amir Goldstein
On Fri, Oct 21, 2016 at 12:30 PM, Miklos Szeredi wrote: > On Fri, Oct 21, 2016 at 11:13 AM, Amir Goldstein wrote: > >> I think it would be a good idea in general to stabilize the overlay ino/dev >> throughout copy-up, same as Miklos suggested to do for directories, to >> all files: >> pure upper

Re: [POC/RFC PATCH] overlayfs: fix data inconsistency at copy up

2016-10-21 Thread Miklos Szeredi
On Fri, Oct 21, 2016 at 11:13 AM, Amir Goldstein wrote: > I think it would be a good idea in general to stabilize the overlay ino/dev > throughout copy-up, same as Miklos suggested to do for directories, to > all files: > pure upper uses upper ino + overlayfs dev > non-pure

Re: [POC/RFC PATCH] overlayfs: fix data inconsistency at copy up

2016-10-21 Thread Miklos Szeredi
On Fri, Oct 21, 2016 at 11:13 AM, Amir Goldstein wrote: > I think it would be a good idea in general to stabilize the overlay ino/dev > throughout copy-up, same as Miklos suggested to do for directories, to > all files: > pure upper uses upper ino + overlayfs dev > non-pure upper uses lower ino

Re: [POC/RFC PATCH] overlayfs: fix data inconsistency at copy up

2016-10-21 Thread Amir Goldstein
On Thu, Oct 20, 2016 at 11:46 PM, Vivek Goyal wrote: > On Wed, Oct 12, 2016 at 03:33:26PM +0200, Miklos Szeredi wrote: >> This is a proof of concept patch to fix the following. >> >> /ovl is in overlay mount and /ovl/foo exists on the lower layer only. >> >> rofd =

Re: [POC/RFC PATCH] overlayfs: fix data inconsistency at copy up

2016-10-21 Thread Amir Goldstein
On Thu, Oct 20, 2016 at 11:46 PM, Vivek Goyal wrote: > On Wed, Oct 12, 2016 at 03:33:26PM +0200, Miklos Szeredi wrote: >> This is a proof of concept patch to fix the following. >> >> /ovl is in overlay mount and /ovl/foo exists on the lower layer only. >> >> rofd = open("/ovl/foo", O_RDONLY); >>

Re: [POC/RFC PATCH] overlayfs: fix data inconsistency at copy up

2016-10-21 Thread Miklos Szeredi
On Thu, Oct 20, 2016 at 04:54:08PM -0400, Vivek Goyal wrote: > On Thu, Oct 20, 2016 at 04:46:30PM -0400, Vivek Goyal wrote: > > [..] > > > +static ssize_t ovl_read_iter(struct kiocb *iocb, struct iov_iter *to) > > > +{ > > > + struct file *file = iocb->ki_filp; > > > + bool isupper =

Re: [POC/RFC PATCH] overlayfs: fix data inconsistency at copy up

2016-10-21 Thread Miklos Szeredi
On Thu, Oct 20, 2016 at 04:54:08PM -0400, Vivek Goyal wrote: > On Thu, Oct 20, 2016 at 04:46:30PM -0400, Vivek Goyal wrote: > > [..] > > > +static ssize_t ovl_read_iter(struct kiocb *iocb, struct iov_iter *to) > > > +{ > > > + struct file *file = iocb->ki_filp; > > > + bool isupper =

Re: [POC/RFC PATCH] overlayfs: fix data inconsistency at copy up

2016-10-21 Thread Amir Goldstein
On Thu, Oct 20, 2016 at 11:54 PM, Vivek Goyal wrote: > On Thu, Oct 20, 2016 at 04:46:30PM -0400, Vivek Goyal wrote: > > [..] >> > +static ssize_t ovl_read_iter(struct kiocb *iocb, struct iov_iter *to) >> > +{ >> > + struct file *file = iocb->ki_filp; >> > + bool isupper =

Re: [POC/RFC PATCH] overlayfs: fix data inconsistency at copy up

2016-10-21 Thread Amir Goldstein
On Thu, Oct 20, 2016 at 11:54 PM, Vivek Goyal wrote: > On Thu, Oct 20, 2016 at 04:46:30PM -0400, Vivek Goyal wrote: > > [..] >> > +static ssize_t ovl_read_iter(struct kiocb *iocb, struct iov_iter *to) >> > +{ >> > + struct file *file = iocb->ki_filp; >> > + bool isupper =

Re: [POC/RFC PATCH] overlayfs: fix data inconsistency at copy up

2016-10-20 Thread Vivek Goyal
On Thu, Oct 20, 2016 at 04:46:30PM -0400, Vivek Goyal wrote: [..] > > +static ssize_t ovl_read_iter(struct kiocb *iocb, struct iov_iter *to) > > +{ > > + struct file *file = iocb->ki_filp; > > + bool isupper = OVL_TYPE_UPPER(ovl_path_type(file->f_path.dentry)); > > + ssize_t ret = -EINVAL;

Re: [POC/RFC PATCH] overlayfs: fix data inconsistency at copy up

2016-10-20 Thread Vivek Goyal
On Thu, Oct 20, 2016 at 04:46:30PM -0400, Vivek Goyal wrote: [..] > > +static ssize_t ovl_read_iter(struct kiocb *iocb, struct iov_iter *to) > > +{ > > + struct file *file = iocb->ki_filp; > > + bool isupper = OVL_TYPE_UPPER(ovl_path_type(file->f_path.dentry)); > > + ssize_t ret = -EINVAL;

Re: [POC/RFC PATCH] overlayfs: fix data inconsistency at copy up

2016-10-20 Thread Vivek Goyal
On Wed, Oct 12, 2016 at 03:33:26PM +0200, Miklos Szeredi wrote: > This is a proof of concept patch to fix the following. > > /ovl is in overlay mount and /ovl/foo exists on the lower layer only. > > rofd = open("/ovl/foo", O_RDONLY); > rwfd = open("/ovl/foo", O_WRONLY); /* this causes copy up

Re: [POC/RFC PATCH] overlayfs: fix data inconsistency at copy up

2016-10-20 Thread Vivek Goyal
On Wed, Oct 12, 2016 at 03:33:26PM +0200, Miklos Szeredi wrote: > This is a proof of concept patch to fix the following. > > /ovl is in overlay mount and /ovl/foo exists on the lower layer only. > > rofd = open("/ovl/foo", O_RDONLY); > rwfd = open("/ovl/foo", O_WRONLY); /* this causes copy up

Re: [POC/RFC PATCH] overlayfs: fix data inconsistency at copy up

2016-10-13 Thread Amir Goldstein
On Wed, Oct 12, 2016 at 4:33 PM, Miklos Szeredi wrote: > This is a proof of concept patch to fix the following. > > /ovl is in overlay mount and /ovl/foo exists on the lower layer only. > > rofd = open("/ovl/foo", O_RDONLY); > rwfd = open("/ovl/foo", O_WRONLY); /* this causes

Re: [POC/RFC PATCH] overlayfs: fix data inconsistency at copy up

2016-10-13 Thread Amir Goldstein
On Wed, Oct 12, 2016 at 4:33 PM, Miklos Szeredi wrote: > This is a proof of concept patch to fix the following. > > /ovl is in overlay mount and /ovl/foo exists on the lower layer only. > > rofd = open("/ovl/foo", O_RDONLY); > rwfd = open("/ovl/foo", O_WRONLY); /* this causes copy up */ >

[POC/RFC PATCH] overlayfs: fix data inconsistency at copy up

2016-10-12 Thread Miklos Szeredi
This is a proof of concept patch to fix the following. /ovl is in overlay mount and /ovl/foo exists on the lower layer only. rofd = open("/ovl/foo", O_RDONLY); rwfd = open("/ovl/foo", O_WRONLY); /* this causes copy up */ write(rwfd, "bar", 3); read(rofd, buf, 3); assert(memcmp(buf, "bar",

[POC/RFC PATCH] overlayfs: fix data inconsistency at copy up

2016-10-12 Thread Miklos Szeredi
This is a proof of concept patch to fix the following. /ovl is in overlay mount and /ovl/foo exists on the lower layer only. rofd = open("/ovl/foo", O_RDONLY); rwfd = open("/ovl/foo", O_WRONLY); /* this causes copy up */ write(rwfd, "bar", 3); read(rofd, buf, 3); assert(memcmp(buf, "bar",