Re: [RFC] should read(2) update the position if it returns an error?

2013-06-18 Thread Al Viro
On Fri, Jun 14, 2013 at 08:38:19AM -0700, Linus Torvalds wrote: > On Fri, Jun 14, 2013 at 1:05 AM, Al Viro wrote: > > > > Comments? I'd obviously prefer to solve it that way (i.e. leave > > ->f_pos untouched if vfs_read() returns an error), but I might be missing > > some case where we

Re: [RFC] should read(2) update the position if it returns an error?

2013-06-18 Thread Al Viro
On Fri, Jun 14, 2013 at 08:38:19AM -0700, Linus Torvalds wrote: On Fri, Jun 14, 2013 at 1:05 AM, Al Viro v...@zeniv.linux.org.uk wrote: Comments? I'd obviously prefer to solve it that way (i.e. leave -f_pos untouched if vfs_read() returns an error), but I might be missing some

Re: [RFC] should read(2) update the position if it returns an error?

2013-06-14 Thread Linus Torvalds
On Fri, Jun 14, 2013 at 1:05 AM, Al Viro wrote: > > Comments? I'd obviously prefer to solve it that way (i.e. leave > ->f_pos untouched if vfs_read() returns an error), but I might be missing > some case where we want position updated even though read() returns an > error. I can't come

[RFC] should read(2) update the position if it returns an error?

2013-06-14 Thread Al Viro
We have an unpleasant HPFS (at least) race with read(2) vs. unlink(2) The thing is, HPFS and several other filesystems keep track of all opened struct file for directory and update the position in it upon directory modifications. For HPFS it's particulary painful, since it encodes the

[RFC] should read(2) update the position if it returns an error?

2013-06-14 Thread Al Viro
We have an unpleasant HPFS (at least) race with read(2) vs. unlink(2) The thing is, HPFS and several other filesystems keep track of all opened struct file for directory and update the position in it upon directory modifications. For HPFS it's particulary painful, since it encodes the

Re: [RFC] should read(2) update the position if it returns an error?

2013-06-14 Thread Linus Torvalds
On Fri, Jun 14, 2013 at 1:05 AM, Al Viro v...@zeniv.linux.org.uk wrote: Comments? I'd obviously prefer to solve it that way (i.e. leave -f_pos untouched if vfs_read() returns an error), but I might be missing some case where we want position updated even though read() returns an