svn commit: r213915 - stable/8/sys/kern

Konstantin Belousov kib at FreeBSD.org
Sat Oct 16 08:43:24 UTC 2010


Author: kib
Date: Sat Oct 16 08:43:23 2010
New Revision: 213915
URL: http://svn.freebsd.org/changeset/base/213915

Log:
  MFC r213359:
  Release the vnode lock and close the linker file vnode earlier in the
  linker_load_file methods. This prevents the LOR between kernel linker sx
  xlock and vnode lock.

Modified:
  stable/8/sys/kern/link_elf.c
  stable/8/sys/kern/link_elf_obj.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/kern/link_elf.c
==============================================================================
--- stable/8/sys/kern/link_elf.c	Sat Oct 16 08:38:12 2010	(r213914)
+++ stable/8/sys/kern/link_elf.c	Sat Oct 16 08:43:23 2010	(r213915)
@@ -967,15 +967,15 @@ nosyms:
     *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 (shdr)
 	free(shdr, M_LINKER);
     if (firstpage)
 	free(firstpage, M_LINKER);
-    VOP_UNLOCK(nd.ni_vp, 0);
-    vn_close(nd.ni_vp, FREAD, td->td_ucred, td);
-    VFS_UNLOCK_GIANT(vfslocked);
 
     return error;
 }

Modified: stable/8/sys/kern/link_elf_obj.c
==============================================================================
--- stable/8/sys/kern/link_elf_obj.c	Sat Oct 16 08:38:12 2010	(r213914)
+++ stable/8/sys/kern/link_elf_obj.c	Sat Oct 16 08:43:23 2010	(r213915)
@@ -885,13 +885,13 @@ link_elf_load_file(linker_class_t cls, c
 	*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;
 }


More information about the svn-src-stable-8 mailing list