Re: [PATCH] nfsd: Make creates return EEXIST correctly instead of EPERM

2016-07-22 Thread J. Bruce Fields
From: "J. Bruce Fields" On Fri, Jul 22, 2016 at 11:13:20AM -0400, Oleg Drokin wrote: > Hm, in fact indeed. I was just too worked up about the client side, > but on the server side there was a real lookup already, so it does > look workable. So I end up with the following. This is all (after you

Re: [PATCH] nfsd: Make creates return EEXIST correctly instead of EPERM

2016-07-22 Thread Oleg Drokin
On Jul 22, 2016, at 6:55 AM, J. Bruce Fields wrote: > On Fri, Jul 22, 2016 at 02:35:26AM -0400, Oleg Drokin wrote: >> >> On Jul 21, 2016, at 9:57 PM, J. Bruce Fields wrote: >> >>> On Thu, Jul 21, 2016 at 04:37:40PM -0400, Oleg Drokin wrote: On Jul 21, 2016, at 4:34 PM, J. Bruce Field

Re: [PATCH] nfsd: Make creates return EEXIST correctly instead of EPERM

2016-07-22 Thread J. Bruce Fields
On Fri, Jul 22, 2016 at 02:35:26AM -0400, Oleg Drokin wrote: > > On Jul 21, 2016, at 9:57 PM, J. Bruce Fields wrote: > > > On Thu, Jul 21, 2016 at 04:37:40PM -0400, Oleg Drokin wrote: > >> > >> On Jul 21, 2016, at 4:34 PM, J. Bruce Fields wrote: > >> > >>> On Fri, Jul 08, 2016 at 05:53:19PM -04

Re: [PATCH] nfsd: Make creates return EEXIST correctly instead of EPERM

2016-07-21 Thread Oleg Drokin
On Jul 21, 2016, at 9:57 PM, J. Bruce Fields wrote: > On Thu, Jul 21, 2016 at 04:37:40PM -0400, Oleg Drokin wrote: >> >> On Jul 21, 2016, at 4:34 PM, J. Bruce Fields wrote: >> >>> On Fri, Jul 08, 2016 at 05:53:19PM -0400, Oleg Drokin wrote: On Jul 8, 2016, at 4:54 PM, J. Bruce Fields

Re: [PATCH] nfsd: Make creates return EEXIST correctly instead of EPERM

2016-07-21 Thread J. Bruce Fields
On Thu, Jul 21, 2016 at 04:37:40PM -0400, Oleg Drokin wrote: > > On Jul 21, 2016, at 4:34 PM, J. Bruce Fields wrote: > > > On Fri, Jul 08, 2016 at 05:53:19PM -0400, Oleg Drokin wrote: > >> > >> On Jul 8, 2016, at 4:54 PM, J. Bruce Fields wrote: > >> > >>> On Thu, Jul 07, 2016 at 09:47:46PM -040

Re: [PATCH] nfsd: Make creates return EEXIST correctly instead of EPERM

2016-07-21 Thread Oleg Drokin
On Jul 21, 2016, at 4:34 PM, J. Bruce Fields wrote: > On Fri, Jul 08, 2016 at 05:53:19PM -0400, Oleg Drokin wrote: >> >> On Jul 8, 2016, at 4:54 PM, J. Bruce Fields wrote: >> >>> On Thu, Jul 07, 2016 at 09:47:46PM -0400, Oleg Drokin wrote: It looks like we are bit overzealous about failing

Re: [PATCH] nfsd: Make creates return EEXIST correctly instead of EPERM

2016-07-21 Thread J. Bruce Fields
On Fri, Jul 08, 2016 at 05:53:19PM -0400, Oleg Drokin wrote: > > On Jul 8, 2016, at 4:54 PM, J. Bruce Fields wrote: > > > On Thu, Jul 07, 2016 at 09:47:46PM -0400, Oleg Drokin wrote: > >> It looks like we are bit overzealous about failing mkdir/create/mknod > >> with permission denied if the pare

Re: [PATCH] nfsd: Make creates return EEXIST correctly instead of EPERM

2016-07-13 Thread J. Bruce Fields
On Fri, Jul 08, 2016 at 11:41:41PM -0400, Oleg Drokin wrote: > > On Jul 8, 2016, at 11:10 PM, Al Viro wrote: > > > On Fri, Jul 08, 2016 at 05:47:22PM -0400, Oleg Drokin wrote: > > > >> I wonder if people just accept that "NFS is just weird" and code in > >> workarounds, > >> where as with Lustr

Re: [PATCH] nfsd: Make creates return EEXIST correctly instead of EPERM

2016-07-08 Thread Oleg Drokin
On Jul 8, 2016, at 11:10 PM, Al Viro wrote: > On Fri, Jul 08, 2016 at 05:47:22PM -0400, Oleg Drokin wrote: > >> I wonder if people just accept that "NFS is just weird" and code in >> workarounds, >> where as with Lustre we promise (almost) full POSIX compliance, and also >> came much later >>

Re: [PATCH] nfsd: Make creates return EEXIST correctly instead of EPERM

2016-07-08 Thread Al Viro
On Fri, Jul 08, 2016 at 10:58:38PM -0400, Oleg Drokin wrote: > > When more than one condition applies, we have every right to return any of > > them. POSIX does *NOT* specify the order of checks. Never had. > > Out of curiosity, why does filename_create() delay EROFS then? QoI and historical b

Re: [PATCH] nfsd: Make creates return EEXIST correctly instead of EPERM

2016-07-08 Thread Al Viro
On Fri, Jul 08, 2016 at 05:47:22PM -0400, Oleg Drokin wrote: > I wonder if people just accept that "NFS is just weird" and code in > workarounds, > where as with Lustre we promise (almost) full POSIX compliance, and also came > much later > so people are just seeing that "this does not work" and

Re: [PATCH] nfsd: Make creates return EEXIST correctly instead of EPERM

2016-07-08 Thread Oleg Drokin
On Jul 8, 2016, at 10:52 PM, Al Viro wrote: > On Fri, Jul 08, 2016 at 11:59:50AM -0400, Oleg Drokin wrote: > >> "If path names a symbolic link, mkdir() shall fail and set errno to >> [EEXIST]." >> >> This sounds pretty straightforward to me, no? >> Since it does not matter that we do not have

Re: [PATCH] nfsd: Make creates return EEXIST correctly instead of EPERM

2016-07-08 Thread Al Viro
On Fri, Jul 08, 2016 at 11:59:50AM -0400, Oleg Drokin wrote: > "If path names a symbolic link, mkdir() shall fail and set errno to [EEXIST]." > > This sounds pretty straightforward to me, no? > Since it does not matter that we do not have write permissions here, because > the name already exists.

Re: [PATCH] nfsd: Make creates return EEXIST correctly instead of EPERM

2016-07-08 Thread Oleg Drokin
On Jul 8, 2016, at 4:54 PM, J. Bruce Fields wrote: > On Thu, Jul 07, 2016 at 09:47:46PM -0400, Oleg Drokin wrote: >> It looks like we are bit overzealous about failing mkdir/create/mknod >> with permission denied if the parent dir is not writeable. >> Need to make sure the name does not exist fir

Re: [PATCH] nfsd: Make creates return EEXIST correctly instead of EPERM

2016-07-08 Thread Oleg Drokin
On Jul 8, 2016, at 4:49 PM, J. Bruce Fields wrote: > On Fri, Jul 08, 2016 at 12:16:14PM -0400, Oleg Drokin wrote: >> >> On Jul 8, 2016, at 12:04 PM, J. Bruce Fields wrote: >> >>> On Fri, Jul 08, 2016 at 11:53:28AM -0400, Jeff Layton wrote: On Fri, 2016-07-08 at 11:14 -0400, Oleg Drokin wro

Re: [PATCH] nfsd: Make creates return EEXIST correctly instead of EPERM

2016-07-08 Thread J. Bruce Fields
On Thu, Jul 07, 2016 at 09:47:46PM -0400, Oleg Drokin wrote: > It looks like we are bit overzealous about failing mkdir/create/mknod > with permission denied if the parent dir is not writeable. > Need to make sure the name does not exist first, because we need to > return EEXIST in that case. > >

Re: [PATCH] nfsd: Make creates return EEXIST correctly instead of EPERM

2016-07-08 Thread J. Bruce Fields
On Fri, Jul 08, 2016 at 12:16:14PM -0400, Oleg Drokin wrote: > > On Jul 8, 2016, at 12:04 PM, J. Bruce Fields wrote: > > > On Fri, Jul 08, 2016 at 11:53:28AM -0400, Jeff Layton wrote: > >> On Fri, 2016-07-08 at 11:14 -0400, Oleg Drokin wrote: > >>> On Jul 8, 2016, at 7:02 AM, Jeff Layton wrote: >

Re: [PATCH] nfsd: Make creates return EEXIST correctly instead of EPERM

2016-07-08 Thread Oleg Drokin
On Jul 8, 2016, at 12:17 PM, Jeff Layton wrote: > On Fri, 2016-07-08 at 11:59 -0400, Oleg Drokin wrote: >> On Jul 8, 2016, at 11:53 AM, Jeff Layton wrote: >> >>> On Fri, 2016-07-08 at 11:14 -0400, Oleg Drokin wrote: On Jul 8, 2016, at 7:02 AM, Jeff Layton wrote: > On Thu, 2016-07-

Re: [PATCH] nfsd: Make creates return EEXIST correctly instead of EPERM

2016-07-08 Thread Jeff Layton
On Fri, 2016-07-08 at 11:59 -0400, Oleg Drokin wrote: > On Jul 8, 2016, at 11:53 AM, Jeff Layton wrote: > > > On Fri, 2016-07-08 at 11:14 -0400, Oleg Drokin wrote: > > > On Jul 8, 2016, at 7:02 AM, Jeff Layton wrote: > > > > > > > On Thu, 2016-07-07 at 21:47 -0400, Oleg Drokin wrote: > > > > > It

Re: [PATCH] nfsd: Make creates return EEXIST correctly instead of EPERM

2016-07-08 Thread Oleg Drokin
On Jul 8, 2016, at 12:04 PM, J. Bruce Fields wrote: > On Fri, Jul 08, 2016 at 11:53:28AM -0400, Jeff Layton wrote: >> On Fri, 2016-07-08 at 11:14 -0400, Oleg Drokin wrote: >>> On Jul 8, 2016, at 7:02 AM, Jeff Layton wrote: >>> On Thu, 2016-07-07 at 21:47 -0400, Oleg Drokin wrote: > It l

Re: [PATCH] nfsd: Make creates return EEXIST correctly instead of EPERM

2016-07-08 Thread J. Bruce Fields
On Fri, Jul 08, 2016 at 11:53:28AM -0400, Jeff Layton wrote: > On Fri, 2016-07-08 at 11:14 -0400, Oleg Drokin wrote: > > On Jul 8, 2016, at 7:02 AM, Jeff Layton wrote: > > > > > On Thu, 2016-07-07 at 21:47 -0400, Oleg Drokin wrote: > > > > It looks like we are bit overzealous about failing mkdir/c

Re: [PATCH] nfsd: Make creates return EEXIST correctly instead of EPERM

2016-07-08 Thread Oleg Drokin
On Jul 8, 2016, at 11:53 AM, Jeff Layton wrote: > On Fri, 2016-07-08 at 11:14 -0400, Oleg Drokin wrote: >> On Jul 8, 2016, at 7:02 AM, Jeff Layton wrote: >> >>> On Thu, 2016-07-07 at 21:47 -0400, Oleg Drokin wrote: It looks like we are bit overzealous about failing mkdir/create/mknod w

Re: [PATCH] nfsd: Make creates return EEXIST correctly instead of EPERM

2016-07-08 Thread Jeff Layton
On Fri, 2016-07-08 at 11:14 -0400, Oleg Drokin wrote: > On Jul 8, 2016, at 7:02 AM, Jeff Layton wrote: > > > On Thu, 2016-07-07 at 21:47 -0400, Oleg Drokin wrote: > > > It looks like we are bit overzealous about failing mkdir/create/mknod > > > with permission denied if the parent dir is not write

Re: [PATCH] nfsd: Make creates return EEXIST correctly instead of EPERM

2016-07-08 Thread Oleg Drokin
On Jul 8, 2016, at 7:02 AM, Jeff Layton wrote: > On Thu, 2016-07-07 at 21:47 -0400, Oleg Drokin wrote: >> It looks like we are bit overzealous about failing mkdir/create/mknod >> with permission denied if the parent dir is not writeable. >> Need to make sure the name does not exist first, because

Re: [PATCH] nfsd: Make creates return EEXIST correctly instead of EPERM

2016-07-08 Thread Jeff Layton
On Thu, 2016-07-07 at 21:47 -0400, Oleg Drokin wrote: > It looks like we are bit overzealous about failing mkdir/create/mknod > with permission denied if the parent dir is not writeable. > Need to make sure the name does not exist first, because we need to > return EEXIST in that case. > > Signed-

[PATCH] nfsd: Make creates return EEXIST correctly instead of EPERM

2016-07-07 Thread Oleg Drokin
It looks like we are bit overzealous about failing mkdir/create/mknod with permission denied if the parent dir is not writeable. Need to make sure the name does not exist first, because we need to return EEXIST in that case. Signed-off-by: Oleg Drokin --- A very similar problem exists with symlin