Subject: RE: [nfsv4] NFS4ERR_EXIST vs NFS4ERR_ISDIR

From: "Halevy, Benny" <[email-masked]>
Date: Fri, 6 Feb 2004 18:16:21 -0500

FreeBSD returns EISDIR when renaming a file onto an existing
directory.  I see that with 4.6.2

- Benny

>-----Original Message-----
>From: [email-masked]
>[mailto:[email-masked]]
>Sent: Friday, February 06, 2004 4:44 PM
>To: [email-masked]
>Subject: [nfsv4] NFS4ERR_EXIST vs NFS4ERR_ISDIR
>
>
>Just an historical note... The section on returning NFS4ERR_EXIST for
>Rename for that case seems to be taken directly from RFC1813 for V3.
>
>Does this imply that "real V3" servers return ISDIR and not EEXIST?
>
>rick
>ps: I don't have a problem with returning EISDIR, just would like to
>    know if there was a reason V3 didn't allow it?
>
>_______________________________________________
>nfsv4 mailing list
>[email-masked]
>https://www1.ietf.org/mailman/listinfo/nfsv4
>

_______________________________________________
nfsv4 mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/nfsv4

---

From: "Halevy, Benny" <[email-masked]>
Date: Fri, 6 Feb 2004 19:50:36 -0500

Peter Staubach wrote:
>Halevy, Benny wrote:
>What does it return when an attempt is made to rename one directory
>to another existing directory where the existing directory is not
>empty?  That's the situation under discussion...
>
>		ps
>
>

In case of a rename of a directory onto an existing directory which
is not empty FreeBSD 4.6.2 returns ENOTEMPTY.  I looked at the server
code and it looks like it just passes whatever error code the
underlying filesystem returns.

By the way, my application running on Solaris sees EEXIST as the
errno so I guess the Solaris client is translating it under the covers.

Benny

---

From: "Talpey, Thomas" <[email-masked]>
Date: Fri, 6 Feb 2004 18:11:44 -0800

At 05:22 PM 2/6/2004, Noveck, Dave wrote:
>return EXIST and not ISDIR.  The fact that RFC1813 is, in general, not
>inclined to limit you on the errors you return, makes the fact that it 
>is so specific, sort of noteworthy.  Just like Rick, I wonder why (although
>I may never find out).
>
>      If the directory, to.dir, already contains an entry with
>      the name, to.name, the source object must be compatible
>      with the target: either both are non-directories or both
>      are directories and the target must be empty. If
>      compatible, the existing target is removed before the
>      rename occurs. If they are not compatible or if the target
>      is a directory but not empty, the server should return the
>      error, NFS3ERR_EXIST.

Especially because it's not Posix:

e.g. <http://www.opengroup.org/onlinepubs/007908799/xsh/rename.html>[EEXIST] or [ENOTEMPTY]  
The link named by new is a directory that is not an empty directory. 
[EISDIR]  
The new argument points to a directory and the old argument points to a file that is not a directory. 
Okay, who wrote that into RFC1813? :-)

Tom.