summaryrefslogtreecommitdiffstats
path: root/sys/kern/link_elf_obj.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2010-10-02 16:04:50 +0000
committerkib <kib@FreeBSD.org>2010-10-02 16:04:50 +0000
commit0b7460fc16c04cf0d0ced5c3152070486883f96c (patch)
treed36404cb078641a8d20a3e6954eb1b7dc40713a3 /sys/kern/link_elf_obj.c
parent2d4f0a4a82f1cf5b082a40443abbe715d7419c78 (diff)
downloadFreeBSD-src-0b7460fc16c04cf0d0ced5c3152070486883f96c.zip
FreeBSD-src-0b7460fc16c04cf0d0ced5c3152070486883f96c.tar.gz
Release the vnode lock and close the linker file vnode earlier in
the linker_load_file methods. The change is that the consequent linker_file_unload() call is not under the vnode lock anymore. This prevents the LOR between kernel linker sx xlock and vnode lock, because linker_file_unload() relocks kernel linker lock. MFC after: 2 weeks
Diffstat (limited to 'sys/kern/link_elf_obj.c')
-rw-r--r--sys/kern/link_elf_obj.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c
index b0df57d..c188852 100644
--- a/sys/kern/link_elf_obj.c
+++ b/sys/kern/link_elf_obj.c
@@ -885,13 +885,13 @@ link_elf_load_file(linker_class_t cls, const char *filename,
*result = lf;
out:
+ VOP_UNLOCK(nd.ni_vp, 0);
+ vn_close(nd.ni_vp, FREAD, td->td_ucred, td);
+ VFS_UNLOCK_GIANT(vfslocked);
if (error && lf)
linker_file_unload(lf, LINKER_UNLOAD_FORCE);
if (hdr)
free(hdr, M_LINKER);
- VOP_UNLOCK(nd.ni_vp, 0);
- vn_close(nd.ni_vp, FREAD, td->td_ucred, td);
- VFS_UNLOCK_GIANT(vfslocked);
return error;
}
OpenPOWER on IntegriCloud