diff options
Diffstat (limited to 'sys/fs/nfsclient')
-rw-r--r-- | sys/fs/nfsclient/nfs_clstate.c | 10 | ||||
-rw-r--r-- | sys/fs/nfsclient/nfs_clvfsops.c | 14 |
2 files changed, 13 insertions, 11 deletions
diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index e3cf76a..2295627 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -675,10 +675,16 @@ nfscl_getcl(vnode_t vp, struct ucred *cred, NFSPROC_T *p, struct nfsclclient *newclp; struct nfscllockowner *lp, *nlp; struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); + struct prison *pr; + char uuid[HOSTUUIDLEN]; int igotlock = 0, error, trystalecnt, clidinusedelay, i; u_int16_t idlen; - idlen = strlen(hostuuid); + pr = cred->cr_prison; + mtx_lock(&pr->pr_mtx); + strlcpy(uuid, pr->pr_uuid, sizeof uuid); + mtx_unlock(&pr->pr_mtx); + idlen = strlen(uuid); if (idlen > 0) idlen += sizeof (u_int64_t); else @@ -699,7 +705,7 @@ nfscl_getcl(vnode_t vp, struct ucred *cred, NFSPROC_T *p, clp->nfsc_flags = NFSCLFLAGS_INITED; clp->nfsc_clientidrev = 1; clp->nfsc_cbident = nfscl_nextcbident(); - nfscl_fillclid(nmp->nm_clval, hostuuid, clp->nfsc_id, + nfscl_fillclid(nmp->nm_clval, uuid, clp->nfsc_id, clp->nfsc_idlen); LIST_INSERT_HEAD(&nfsclhead, clp, nfsc_list); nmp->nm_clp = clp; diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c index 73fb4e3..01f41df 100644 --- a/sys/fs/nfsclient/nfs_clvfsops.c +++ b/sys/fs/nfsclient/nfs_clvfsops.c @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include <sys/bio.h> #include <sys/buf.h> #include <sys/clock.h> +#include <sys/jail.h> #include <sys/lock.h> #include <sys/malloc.h> #include <sys/mbuf.h> @@ -368,12 +369,11 @@ int ncl_mountroot(struct mount *mp) { struct thread *td = curthread; - INIT_VPROCG(TD_TO_VPROCG(td)); struct nfsv3_diskless *nd = &newnfsv3_diskless; struct socket *so; struct vnode *vp; struct ifreq ir; - int error, i; + int error; u_long l; char buf[128]; char *cp; @@ -477,13 +477,9 @@ ncl_mountroot(struct mount *mp) * set hostname here and then let the "/etc/rc.xxx" files * mount the right /var based upon its preset value. */ - mtx_lock(&hostname_mtx); - bcopy(nd->my_hostnam, V_hostname, MAXHOSTNAMELEN); - V_hostname[MAXHOSTNAMELEN - 1] = '\0'; - for (i = 0; i < MAXHOSTNAMELEN; i++) - if (V_hostname[i] == '\0') - break; - mtx_unlock(&hostname_mtx); + mtx_lock(&prison0.pr_mtx); + strlcpy(prison0.pr_host, nd->my_hostnam, sizeof(prison0.pr_host)); + mtx_unlock(&prison0.pr_mtx); inittodr(ntohl(nd->root_time)); return (0); } |