Page MenuHomeFreeBSD

D34470.diff
No OneTemporary

D34470.diff

diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c
--- a/sys/fs/nfsserver/nfs_nfsdport.c
+++ b/sys/fs/nfsserver/nfs_nfsdport.c
@@ -1172,7 +1172,6 @@
error = nd->nd_repstat;
if (!error && ndp->ni_vp == NULL) {
if (nvap->na_type == VREG || nvap->na_type == VSOCK) {
- vrele(ndp->ni_startdir);
error = VOP_CREATE(ndp->ni_dvp,
&ndp->ni_vp, &ndp->ni_cnd, &nvap->na_vattr);
/* For a pNFS server, create the data file on a DS. */
@@ -1213,7 +1212,6 @@
nvap->na_type = VFIFO;
if (nvap->na_type != VFIFO &&
(error = priv_check_cred(nd->nd_cred, PRIV_VFS_MKNOD_DEV))) {
- vrele(ndp->ni_startdir);
nfsvno_relpathbuf(ndp);
vput(ndp->ni_dvp);
goto out;
@@ -1224,11 +1222,9 @@
VOP_VPUT_PAIR(ndp->ni_dvp, error == 0 ? &ndp->ni_vp :
NULL, false);
nfsvno_relpathbuf(ndp);
- vrele(ndp->ni_startdir);
if (error)
goto out;
} else {
- vrele(ndp->ni_startdir);
nfsvno_relpathbuf(ndp);
vput(ndp->ni_dvp);
error = ENXIO;
@@ -1242,7 +1238,6 @@
* 1 - clean up the lookup
* 2 - iff !error and na_size set, truncate it
*/
- vrele(ndp->ni_startdir);
nfsvno_relpathbuf(ndp);
*vpp = ndp->ni_vp;
if (ndp->ni_dvp == *vpp)
@@ -1285,7 +1280,6 @@
* Iff doesn't exist, create it.
*/
if (ndp->ni_vp) {
- vrele(ndp->ni_startdir);
nfsvno_relpathbuf(ndp);
vput(ndp->ni_dvp);
vrele(ndp->ni_vp);
@@ -1293,14 +1287,12 @@
goto out;
}
if (vtyp != VCHR && vtyp != VBLK && vtyp != VSOCK && vtyp != VFIFO) {
- vrele(ndp->ni_startdir);
nfsvno_relpathbuf(ndp);
vput(ndp->ni_dvp);
error = NFSERR_BADTYPE;
goto out;
}
if (vtyp == VSOCK) {
- vrele(ndp->ni_startdir);
error = VOP_CREATE(ndp->ni_dvp, &ndp->ni_vp,
&ndp->ni_cnd, &nvap->na_vattr);
VOP_VPUT_PAIR(ndp->ni_dvp, error == 0 ? &ndp->ni_vp : NULL,
@@ -1309,7 +1301,6 @@
} else {
if (nvap->na_type != VFIFO &&
(error = priv_check_cred(cred, PRIV_VFS_MKNOD_DEV))) {
- vrele(ndp->ni_startdir);
nfsvno_relpathbuf(ndp);
vput(ndp->ni_dvp);
goto out;
@@ -1319,7 +1310,6 @@
VOP_VPUT_PAIR(ndp->ni_dvp, error == 0 ? &ndp->ni_vp : NULL,
false);
nfsvno_relpathbuf(ndp);
- vrele(ndp->ni_startdir);
/*
* Since VOP_MKNOD returns the ni_vp, I can't
* see any reason to do the lookup.
@@ -1371,7 +1361,6 @@
int error = 0;
if (ndp->ni_vp) {
- vrele(ndp->ni_startdir);
nfsvno_relpathbuf(ndp);
if (ndp->ni_dvp == ndp->ni_vp)
vrele(ndp->ni_dvp);
@@ -1391,7 +1380,6 @@
* Just vput it for v2.
*/
VOP_VPUT_PAIR(ndp->ni_dvp, &ndp->ni_vp, !not_v2 && error == 0);
- vrele(ndp->ni_startdir);
nfsvno_relpathbuf(ndp);
out:
@@ -1642,10 +1630,8 @@
NFSD_DEBUG(4, "nfsvno_rename: pnfsremove\n");
}
- vrele(tondp->ni_startdir);
nfsvno_relpathbuf(tondp);
out1:
- vrele(fromndp->ni_startdir);
nfsvno_relpathbuf(fromndp);
NFSEXITCODE(error);
return (error);
@@ -1862,7 +1848,6 @@
stateidp, stp, NULL, nd, p, nd->nd_repstat);
if (!nd->nd_repstat) {
if (ndp->ni_vp == NULL) {
- vrele(ndp->ni_startdir);
nd->nd_repstat = VOP_CREATE(ndp->ni_dvp,
&ndp->ni_vp, &ndp->ni_cnd, &nvap->na_vattr);
/* For a pNFS server, create the data file on a DS. */
@@ -1900,8 +1885,6 @@
}
vp = ndp->ni_vp;
} else {
- if (ndp->ni_startdir)
- vrele(ndp->ni_startdir);
nfsvno_relpathbuf(ndp);
vp = ndp->ni_vp;
if (create == NFSV4OPEN_CREATE) {
@@ -1935,8 +1918,7 @@
}
} else {
nfsvno_relpathbuf(ndp);
- if (ndp->ni_startdir && create == NFSV4OPEN_CREATE) {
- vrele(ndp->ni_startdir);
+ if (create == NFSV4OPEN_CREATE) {
if (ndp->ni_dvp == ndp->ni_vp)
vrele(ndp->ni_dvp);
else
@@ -4186,7 +4168,7 @@
int error;
NFSNAMEICNDSET(&named.ni_cnd, tcred, CREATE,
- LOCKPARENT | LOCKLEAF | SAVESTART | NOCACHE);
+ LOCKPARENT | LOCKLEAF | NOCACHE);
nfsvno_setpathbuf(&named, &bufp, &hashp);
named.ni_cnd.cn_lkflags = LK_EXCLUSIVE;
named.ni_cnd.cn_nameptr = bufp;
diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c
--- a/sys/fs/nfsserver/nfs_nfsdserv.c
+++ b/sys/fs/nfsserver/nfs_nfsdserv.c
@@ -611,7 +611,7 @@
}
NFSNAMEICNDSET(&named.ni_cnd, nd->nd_cred, LOOKUP,
- LOCKLEAF | SAVESTART);
+ LOCKLEAF);
nfsvno_setpathbuf(&named, &bufp, &hashp);
error = nfsrv_parsename(nd, bufp, hashp, &named.ni_pathlen);
if (error) {
@@ -636,8 +636,6 @@
nfsrv_postopattr(nd, dattr_ret, &dattr);
goto out;
}
- if (named.ni_startdir)
- vrele(named.ni_startdir);
nfsvno_relpathbuf(&named);
vp = named.ni_vp;
if ((nd->nd_flag & ND_NFSV4) != 0 && !NFSVNO_EXPORTED(exp) &&
@@ -1160,7 +1158,7 @@
goto out;
}
NFSNAMEICNDSET(&named.ni_cnd, nd->nd_cred, CREATE,
- LOCKPARENT | LOCKLEAF | SAVESTART | NOCACHE);
+ LOCKPARENT | LOCKLEAF | NOCACHE);
nfsvno_setpathbuf(&named, &bufp, &hashp);
error = nfsrv_parsename(nd, bufp, hashp, &named.ni_pathlen);
if (error)
@@ -1325,7 +1323,7 @@
struct thread *p = curthread;
NFSVNO_ATTRINIT(&nva);
- cnflags = (LOCKPARENT | SAVESTART);
+ cnflags = LOCKPARENT;
if (nd->nd_repstat) {
nfsrv_wcc(nd, dirfor_ret, &dirfor, diraft_ret, &diraft);
goto out;
@@ -1633,7 +1631,7 @@
fdirfor_ret = nfsvno_getattr(dp, &fdirfor, nd, p, 1, NULL);
tond.ni_cnd.cn_nameiop = 0;
tond.ni_startdir = NULL;
- NFSNAMEICNDSET(&fromnd.ni_cnd, nd->nd_cred, DELETE, WANTPARENT | SAVESTART);
+ NFSNAMEICNDSET(&fromnd.ni_cnd, nd->nd_cred, DELETE, WANTPARENT);
nfsvno_setpathbuf(&fromnd, &bufp, &hashp);
error = nfsrv_parsename(nd, bufp, hashp, &fromnd.ni_pathlen);
if (error) {
@@ -1694,7 +1692,7 @@
}
}
}
- NFSNAMEICNDSET(&tond.ni_cnd, nd->nd_cred, RENAME, LOCKPARENT | LOCKLEAF | NOCACHE | SAVESTART);
+ NFSNAMEICNDSET(&tond.ni_cnd, nd->nd_cred, RENAME, LOCKPARENT | LOCKLEAF | NOCACHE);
nfsvno_setpathbuf(&tond, &tbufp, &hashp);
if (!nd->nd_repstat) {
error = nfsrv_parsename(nd, tbufp, hashp, &tond.ni_pathlen);
@@ -1900,7 +1898,7 @@
*vpp = NULL;
NFSVNO_ATTRINIT(&nva);
NFSNAMEICNDSET(&named.ni_cnd, nd->nd_cred, CREATE,
- LOCKPARENT | SAVESTART | NOCACHE);
+ LOCKPARENT | NOCACHE);
nfsvno_setpathbuf(&named, &bufp, &hashp);
error = nfsrv_parsename(nd, bufp, hashp, &named.ni_pathlen);
if (!error && !nd->nd_repstat)
@@ -3018,10 +3016,10 @@
}
if (create == NFSV4OPEN_CREATE)
NFSNAMEICNDSET(&named.ni_cnd, nd->nd_cred, CREATE,
- LOCKPARENT | LOCKLEAF | SAVESTART | NOCACHE);
+ LOCKPARENT | LOCKLEAF | NOCACHE);
else
NFSNAMEICNDSET(&named.ni_cnd, nd->nd_cred, LOOKUP,
- LOCKLEAF | SAVESTART);
+ LOCKLEAF);
nfsvno_setpathbuf(&named, &bufp, &hashp);
error = nfsrv_parsename(nd, bufp, hashp, &named.ni_pathlen);
if (error) {
@@ -3687,7 +3685,7 @@
* All this just to get the export flags for the name.
*/
NFSNAMEICNDSET(&named.ni_cnd, nd->nd_cred, LOOKUP,
- LOCKLEAF | SAVESTART);
+ LOCKLEAF);
nfsvno_setpathbuf(&named, &bufp, &hashp);
error = nfsrv_parsename(nd, bufp, hashp, &named.ni_pathlen);
if (error) {
@@ -3705,7 +3703,6 @@
vrele(dirp);
if (nd->nd_repstat)
goto out;
- vrele(named.ni_startdir);
nfsvno_relpathbuf(&named);
fh.nfsrvfh_len = NFSX_MYFH;
vp = named.ni_vp;
@@ -3826,7 +3823,7 @@
goto nfsmout;
}
NFSNAMEICNDSET(&named.ni_cnd, nd->nd_cred, LOOKUP,
- LOCKLEAF | SAVESTART);
+ LOCKLEAF);
nfsvno_setpathbuf(&named, &bufp, &hashp);
error = nfsrv_parsename(nd, bufp, hashp, &named.ni_pathlen);
if (error != 0) {
@@ -3840,7 +3837,6 @@
vput(dp);
if (dirp != NULL)
vrele(dirp);
- vrele(named.ni_startdir);
nfsvno_relpathbuf(&named);
vp = named.ni_vp;
break;

File Metadata

Mime Type
text/plain
Expires
Mon, Jan 27, 8:52 AM (3 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16193028
Default Alt Text
D34470.diff (7 KB)

Event Timeline