Re: [PATCH 1/2] vfs: pass ppos=NULL to .read()/.write() of FMODE_STREAM files

2019-04-13 Thread Kirill Smelkov
On Sat, Apr 13, 2019 at 10:27:00AM -0700, Linus Torvalds wrote: > On Sat, Apr 13, 2019 at 9:55 AM Kirill Smelkov wrote: > > > > --- a/fs/read_write.c > > +++ b/fs/read_write.c > > @@ -371,7 +371,7 @@ int rw_verify_area(int read_write, struct file *file, > > const loff_t *ppos, size_t > >

Re: [PATCH 1/2] vfs: pass ppos=NULL to .read()/.write() of FMODE_STREAM files

2019-04-13 Thread Al Viro
On Sat, Apr 13, 2019 at 10:27:00AM -0700, Linus Torvalds wrote: > And I'd really like to have people (Al?) look at this and go "yeah, > makes sense". I do think that moving to a model where we wither have a > (properly locked) file position or no pos pointer at all is the right > model (ie I'd

Re: [PATCH 1/2] vfs: pass ppos=NULL to .read()/.write() of FMODE_STREAM files

2019-04-13 Thread Linus Torvalds
On Sat, Apr 13, 2019 at 9:55 AM Kirill Smelkov wrote: > > --- a/fs/read_write.c > +++ b/fs/read_write.c > @@ -371,7 +371,7 @@ int rw_verify_area(int read_write, struct file *file, > const loff_t *ppos, size_t > inode = file_inode(file); > if (unlikely((ssize_t) count < 0)) >

[PATCH 1/2] vfs: pass ppos=NULL to .read()/.write() of FMODE_STREAM files

2019-04-13 Thread Kirill Smelkov
This amends commit 10dce8af3422 ("fs: stream_open - opener for stream-like files so that read and write can run simultaneously without deadlock") in how position is passed into .read()/.write() handler for stream-like files: Rasmus noticed that we currently pass 0 as position and ignore any