Subject: Re: NFSv3 & O_EXCL
To: Manuel Bouyer <bouyer@antioche.lip6.fr>
From: Frank van der Linden <fvdl@vaasje.org>
List: tech-kern
Date: 07/24/2000 20:49:22
On Mon, Jul 24, 2000 at 06:10:28PM +0200, Manuel Bouyer wrote:
> Hi,
> Aidan Cully pointed out the following on tech-userlevel:
> when opening a file with O_EXCL, and using NFSv3 and the server doesn't
> support NFSV3CREATE_EXCLUSIVE, then NetBSD will silently drop the
> O_EXCL flag an retry the operation (code fragment from nfs_vnops,, around
> line 1383, in nfs_create():
>                 if (v3 && (fmode & O_EXCL) && error == NFSERR_NOTSUPP) {
>                         fmode &= ~O_EXCL; 
>                         goto again;
>                 }
>                 if (newvp) 
>                         vrele(newvp);
> 
> 
> This is bad because some programs uses this to do access lock (mail programs
> comes to mind but there are others), so that the problem in known.
> At the very last we should log to console a big WARNING here, but IMHO
> we should just return EOPNOTSUPP.

That seems better. But, is there any standard behavior for this sort
of thing? Is there any standard that says what an open with O_EXCL can
or can not return?

- Frank