Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Feb 2007 23:56:40 -0600
From:      Eric Anderson <anderson@freebsd.org>
To:        "freebsd-fs@freebsd.org" <freebsd-fs@freebsd.org>
Subject:   question about vfs_lookup
Message-ID:  <45D69918.3000008@freebsd.org>

next in thread | raw e-mail | index | archive | help
I'm just curious about how this block (starting at line 712) could 
possibly ever get executed, since right before it there is a condition 
that would cause a panic.

Can anyone explain this please?


In sys/kern/vfs_lookup.c:
710         KASSERT((cnp->cn_flags & ISLASTCN) || *ndp->ni_next == '/',
711             ("lookup: invalid path state."));
712         if (*ndp->ni_next == '/') {
713                 cnp->cn_nameptr = ndp->ni_next;
714                 while (*cnp->cn_nameptr == '/') {
715                         cnp->cn_nameptr++;
716                         ndp->ni_pathlen--;
717                 }
718                 if (ndp->ni_dvp != dp)
719                         vput(ndp->ni_dvp);
720                 else
721                         vrele(ndp->ni_dvp);
722                 VFS_UNLOCK_GIANT(dvfslocked);
723                 dvfslocked = vfslocked; /* dp becomes dvp in dirloop */
724                 vfslocked = 0;
725                 goto dirloop;
726         }


Thanks!
Eric





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?45D69918.3000008>