Subject: NFSv3 & O_EXCL
To: None <tech-kern@netbsd.org>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: tech-kern
Date: 07/24/2000 18:10:28
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.

Comments ?

--
Manuel Bouyer, LIP6, Universite Paris VI.           Manuel.Bouyer@lip6.fr
--