diff options
| author | Jeff Roberson <jeff@FreeBSD.org> | 2002-07-07 22:35:47 +0000 |
|---|---|---|
| committer | Jeff Roberson <jeff@FreeBSD.org> | 2002-07-07 22:35:47 +0000 |
| commit | 31965a72c982817157e61ae65eb084a693dfed23 (patch) | |
| tree | 948ebbd498386a750658643fbe40aeb883a1a0e5 /sys/kern/kern_linker.c | |
| parent | b799f5a475edf63eda8ebb3fadfa6ffff4fa854d (diff) | |
Notes
Diffstat (limited to 'sys/kern/kern_linker.c')
| -rw-r--r-- | sys/kern/kern_linker.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index a506726caccf..b5c1f7df3f07 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -1421,9 +1421,6 @@ linker_lookup_file(const char *path, int pathlen, const char *name, * Lookup KLD which contains requested module in the "linker.hints" file. If * version specification is available, then try to find the best KLD. * Otherwise just find the latest one. - * - * XXX: Vnode locking here is hosed; lock should be held for calls to - * VOP_GETATTR() and vn_rdwr(). */ static char * linker_hints_lookup(const char *path, int pathlen, const char *modname, @@ -1453,7 +1450,6 @@ linker_hints_lookup(const char *path, int pathlen, const char *modname, if (error) goto bad; NDFREE(&nd, NDF_ONLY_PNBUF); - VOP_UNLOCK(nd.ni_vp, 0, td); if (nd.ni_vp->v_type != VREG) goto bad; best = cp = NULL; @@ -1474,6 +1470,7 @@ linker_hints_lookup(const char *path, int pathlen, const char *modname, UIO_SYSSPACE, IO_NODELOCKED, cred, &reclen, td); if (error) goto bad; + VOP_UNLOCK(nd.ni_vp, 0, td); vn_close(nd.ni_vp, FREAD, cred, td); nd.ni_vp = NULL; if (reclen != 0) { @@ -1539,8 +1536,10 @@ linker_hints_lookup(const char *path, int pathlen, const char *modname, bad: if (hints) free(hints, M_TEMP); - if (nd.ni_vp != NULL) + if (nd.ni_vp != NULL) { + VOP_UNLOCK(nd.ni_vp, 0, td); vn_close(nd.ni_vp, FREAD, cred, td); + } /* * If nothing found or hints is absent - fallback to the old * way by using "kldname[.ko]" as module name. |
