Skip to content

Commit

Permalink
Add SAVENAME to the cn_flags for all cases in the experimental
Browse files Browse the repository at this point in the history
NFS server for the CREATE cn_nameiop where SAVESTART isn't set.
I was not aware that this needed to be done by the caller until
recently.

Tested by:	lampa AT fit.vutbr.cz (link case)
Submitted by:	lampa AT fit.vutbr.cz (link case)
MFC after:	2 weeks
  • Loading branch information
rmacklem authored and rmacklem committed Apr 2, 2010
1 parent 31655aa commit 3c1cb22
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions sys/fs/nfsserver/nfs_nfsdserv.c
Expand Up @@ -1086,7 +1086,7 @@ nfsrvd_mknod(struct nfsrv_descript *nd, __unused int isdgram,
case NFFIFO:
break;
case NFDIR:
cnflags = LOCKPARENT;
cnflags = (LOCKPARENT | SAVENAME);
break;
default:
nd->nd_repstat = NFSERR_BADTYPE;
Expand Down Expand Up @@ -1549,7 +1549,8 @@ nfsrvd_link(struct nfsrv_descript *nd, int isdgram,
NFSVOPUNLOCK(dp, 0, p);
}
}
NFSNAMEICNDSET(&named.ni_cnd, nd->nd_cred, CREATE, LOCKPARENT);
NFSNAMEICNDSET(&named.ni_cnd, nd->nd_cred, CREATE,
LOCKPARENT | SAVENAME);
if (!nd->nd_repstat) {
nfsvno_setpathbuf(&named, &bufp, &hashp);
error = nfsrv_parsename(nd, bufp, hashp, &named.ni_pathlen);
Expand Down Expand Up @@ -1743,7 +1744,8 @@ nfsrvd_mkdir(struct nfsrv_descript *nd, __unused int isdgram,
nfsrv_wcc(nd, dirfor_ret, &dirfor, diraft_ret, &diraft);
return (0);
}
NFSNAMEICNDSET(&named.ni_cnd, nd->nd_cred, CREATE, LOCKPARENT);
NFSNAMEICNDSET(&named.ni_cnd, nd->nd_cred, CREATE,
LOCKPARENT | SAVENAME);
nfsvno_setpathbuf(&named, &bufp, &hashp);
error = nfsrv_parsename(nd, bufp, hashp, &named.ni_pathlen);
if (error) {
Expand Down

0 comments on commit 3c1cb22

Please sign in to comment.