summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_cache.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2009-03-20 11:00:39 +0000
committerkib <kib@FreeBSD.org>2009-03-20 11:00:39 +0000
commitbbdc41384b2cdeca57ee24a3e57ae67093570d07 (patch)
tree772014575f92e9f4e2dedee66e190e916b2d9703 /sys/kern/vfs_cache.c
parent6c64d839464d985311827eb8e31d3bbdb6523992 (diff)
downloadFreeBSD-src-bbdc41384b2cdeca57ee24a3e57ae67093570d07.zip
FreeBSD-src-bbdc41384b2cdeca57ee24a3e57ae67093570d07.tar.gz
Do not forget to adjust buflen for the first resolution of the path
from namecache. While there, compare pointers for equiality. Reviewed by: marcus Tested by: pho
Diffstat (limited to 'sys/kern/vfs_cache.c')
-rw-r--r--sys/kern/vfs_cache.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c
index dedce0a..8cc0bb4 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -956,7 +956,8 @@ vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir,
if (vp->v_type != VDIR) {
ncp = TAILQ_FIRST(&vp->v_cache_dst);
if (ncp != NULL) {
- for (i = ncp->nc_nlen - 1; i >= 0 && bp > buf; i--)
+ buflen -= ncp->nc_nlen;
+ for (i = ncp->nc_nlen - 1; i >= 0 && bp != buf; i--)
*--bp = ncp->nc_name[i];
if (bp == buf) {
numfullpathfail4++;
OpenPOWER on IntegriCloud