Fix two problems with NFSV3CREATE_GUARDED:

* We shouldn't truncate the file.
* We were leaving the vnode locked (unless the truncate happened to fail).
Solaris clients may cause this under some conditions.
Problem reported by chopps, analysis and fix by me.
This commit is contained in:
mycroft 1999-03-30 12:01:18 +00:00
parent 4feae58ec1
commit afa07de60d

View File

@ -1,4 +1,4 @@
/* $NetBSD: nfs_serv.c,v 1.49 1999/03/24 05:51:28 mrg Exp $ */
/* $NetBSD: nfs_serv.c,v 1.50 1999/03/30 12:01:18 mycroft Exp $ */
/*
* Copyright (c) 1989, 1993
@ -1456,7 +1456,7 @@ nfsrv_create(nfsd, slp, procp, mrq)
else
vput(nd.ni_dvp);
VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd);
if (va.va_size != -1) {
if (!error && va.va_size != -1) {
error = nfsrv_access(vp, VWRITE, cred,
(nd.ni_cnd.cn_flags & RDONLY), procp, 0);
if (!error) {
@ -1467,9 +1467,9 @@ nfsrv_create(nfsd, slp, procp, mrq)
error = VOP_SETATTR(vp, &va, cred,
procp);
}
if (error)
vput(vp);
}
if (error)
vput(vp);
}
if (!error) {
memset((caddr_t)fhp, 0, sizeof(nfh));