The nc_nlen member of the struct namecache contains the length of the cached

name, not the length + 1.

PR:	132620, 132542
Reported by:	bf2006a yahoo com
Tested by:	bf2006a, pho
Reviewed by:	marcus
This commit is contained in:
Konstantin Belousov 2009-03-20 10:59:06 +00:00
parent c4a8c2ee24
commit 065fc451f8

View File

@ -997,7 +997,7 @@ vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir,
ncp = TAILQ_FIRST(&vp->v_cache_dst);
if (ncp != NULL) {
MPASS(vp->v_dd == NULL || ncp->nc_dvp == vp->v_dd);
buflen -= ncp->nc_nlen - 1;
buflen -= ncp->nc_nlen;
for (i = ncp->nc_nlen - 1; i >= 0 && bp != buf; i--)
*--bp = ncp->nc_name[i];
if (bp == buf) {