Re: [RFC PATCH] fs: Add user_file_or_path_at and use it for truncate

2013-08-28 Thread Andy Lutomirski
On Wed, Aug 28, 2013 at 12:59 PM, Al Viro wrote: > On Wed, Aug 28, 2013 at 12:04:43PM -0700, Andy Lutomirski wrote: >> On Tue, Aug 27, 2013 at 11:16 PM, Al Viro wrote: >> > On Tue, Aug 27, 2013 at 01:28:27PM -0700, Andy Lutomirski wrote: >> >> There are also O_PATH fds, and I'm not sure what the

Re: [RFC PATCH] fs: Add user_file_or_path_at and use it for truncate

2013-08-28 Thread Al Viro
On Wed, Aug 28, 2013 at 12:04:43PM -0700, Andy Lutomirski wrote: > On Tue, Aug 27, 2013 at 11:16 PM, Al Viro wrote: > > On Tue, Aug 27, 2013 at 01:28:27PM -0700, Andy Lutomirski wrote: > >> There are also O_PATH fds, and I'm not sure what the semantics of > >> O_PATH fds are or should be when they

Re: [RFC PATCH] fs: Add user_file_or_path_at and use it for truncate

2013-08-28 Thread Andy Lutomirski
On Tue, Aug 27, 2013 at 11:16 PM, Al Viro wrote: > On Tue, Aug 27, 2013 at 01:28:27PM -0700, Andy Lutomirski wrote: >> There are also O_PATH fds, and I'm not sure what the semantics of >> O_PATH fds are or should be when they refer to something other than a >> directory. > > O_PATH file just point

Re: [RFC PATCH] fs: Add user_file_or_path_at and use it for truncate

2013-08-28 Thread Linus Torvalds
Pseudo-related: I just reverted the flink() commit in my tree, so that at least wrt that whole thing we'll be back to the original behavior, broken or not. Clearly we're not done with this discussion, and the patches flying around aren't appropriate for 3.11, so.. Linus -- To unsubs

Re: [RFC PATCH] fs: Add user_file_or_path_at and use it for truncate

2013-08-27 Thread Al Viro
On Tue, Aug 27, 2013 at 01:28:27PM -0700, Andy Lutomirski wrote: > It would if it works. It certainly would for truncate, setxattr, etc. > > There are funny cases, though. For example, execing an O_WRONLY fd > should probably fail, as should opening an O_WRONLY fd as O_RDWR. > O_APPEND is also

Re: [RFC PATCH] fs: Add user_file_or_path_at and use it for truncate

2013-08-27 Thread Andy Lutomirski
On Tue, Aug 27, 2013 at 4:08 PM, Al Viro wrote: > On Tue, Aug 27, 2013 at 12:16:34PM -0700, Andy Lutomirski wrote: >> This is an experiment to see if we can get nice semantics for all syscalls >> that either follow symlinks or allow AT_EMPTY_PATH without jumping through >> enormous hoops. This co

Re: [RFC PATCH] fs: Add user_file_or_path_at and use it for truncate

2013-08-27 Thread Al Viro
On Tue, Aug 27, 2013 at 12:16:34PM -0700, Andy Lutomirski wrote: > This is an experiment to see if we can get nice semantics for all syscalls > that either follow symlinks or allow AT_EMPTY_PATH without jumping through > enormous hoops. This converts truncate (although you can't tell using > trunc

Re: [RFC PATCH] fs: Add user_file_or_path_at and use it for truncate

2013-08-27 Thread Andy Lutomirski
On Tue, Aug 27, 2013 at 12:32 PM, Linus Torvalds wrote: > On Tue, Aug 27, 2013 at 12:16 PM, Andy Lutomirski wrote: >> This is an experiment to see if we can get nice semantics for all syscalls >> that either follow symlinks or allow AT_EMPTY_PATH without jumping through >> enormous hoops. This c

Re: [RFC PATCH] fs: Add user_file_or_path_at and use it for truncate

2013-08-27 Thread Linus Torvalds
On Tue, Aug 27, 2013 at 12:16 PM, Andy Lutomirski wrote: > This is an experiment to see if we can get nice semantics for all syscalls > that either follow symlinks or allow AT_EMPTY_PATH without jumping through > enormous hoops. This converts truncate (although you can't tell using > truncate fro

[RFC PATCH] fs: Add user_file_or_path_at and use it for truncate

2013-08-27 Thread Andy Lutomirski
This is an experiment to see if we can get nice semantics for all syscalls that either follow symlinks or allow AT_EMPTY_PATH without jumping through enormous hoops. This converts truncate (although you can't tell using truncate from coreutils, because it actually uses open + ftruncate). The basi