Re: [PATCH 4/9] vfs: intercept reads to overlay files

2017-02-20 Thread Miklos Szeredi
On Mon, Feb 20, 2017 at 8:47 AM, zhangyi (F) wrote: > On 2017/2/18 00:10, Miklos Szeredi wrote: >> diff --git a/fs/open.c b/fs/open.c >> index 9921f70bc5ca..4916ccff29f5 100644 >> --- a/fs/open.c >> +++ b/fs/open.c >> @@ -762,6 +762,8 @@ static int do_dentry_open(struct file *f, >> if ((f->f

Re: [PATCH 4/9] vfs: intercept reads to overlay files

2017-02-20 Thread zhangyi (F)
On 2017/2/18 00:10, Miklos Szeredi wrote: > diff --git a/fs/open.c b/fs/open.c > index 9921f70bc5ca..4916ccff29f5 100644 > --- a/fs/open.c > +++ b/fs/open.c > @@ -762,6 +762,8 @@ static int do_dentry_open(struct file *f, > if ((f->f_mode & FMODE_WRITE) && >likely(f->f_op->write ||

Re: [PATCH 4/9] vfs: intercept reads to overlay files

2017-02-19 Thread Miklos Szeredi
On Sun, Feb 19, 2017 at 10:05 AM, Al Viro wrote: > On Fri, Feb 17, 2017 at 05:09:33PM +0100, Miklos Szeredi wrote: >> ...in order to handle the corner case when the file is copyied up after >> being opened read-only. > >> --- /dev/null >> +++ b/fs/overlay_util.c >> @@ -0,0 +1,39 @@ >> +/* >> + * C

Re: [PATCH 4/9] vfs: intercept reads to overlay files

2017-02-19 Thread Al Viro
On Fri, Feb 17, 2017 at 05:09:33PM +0100, Miklos Szeredi wrote: > ...in order to handle the corner case when the file is copyied up after > being opened read-only. > --- /dev/null > +++ b/fs/overlay_util.c > @@ -0,0 +1,39 @@ > +/* > + * Copyright (C) 2017 Red Hat, Inc. > + * > + * This program is

[PATCH 4/9] vfs: intercept reads to overlay files

2017-02-17 Thread Miklos Szeredi
...in order to handle the corner case when the file is copyied up after being opened read-only. Can be verified with the following script: - 8< - - - - - 8< - - - - - 8< - - - - - 8< - - - - cd / rm -rf /tmp/ovl-rorw-test mkdir /tmp/ovl-rorw-test cd /tmp/ovl-rorw-test mkdir -p mnt lower upper wo