On Mon, Aug 04, 2008 at 09:19:07AM -0400, John Baldwin wrote: > On Sunday 03 August 2008 09:33:45 am Konstantin Belousov wrote: > > kib 2008-08-03 13:33:45 UTC > > > > FreeBSD src repository > > > > Modified files: > > sys/kern link_elf.c link_elf_obj.c > > Log: > > SVN rev 181235 on 2008-08-03 13:33:45Z by kib > > > > Calling linker_load_dependencies() while holding the module' > > vnode lock may cause a LOR between kld_sx lock and vnode lock. > > linker_load_dependencies() drops kld_sx, and another thread may attempt > > to load the same kld. > > > > Reported and tested by: pjd > > MFC after: 1 week > > If it is safe to drop the vnode lock here, is there any reason we can't just > drop it earlier and not bother reacquiring it?
It is safe because the vnode is referenced by vn_open(), and lock reacquisition is done with LK_RETRY. After the linker_load_dependencies(), optional symbol table loading is performed, that requires reading from the module file. It seems to be a natural location for the operation.
pgpaufsVdhsIV.pgp
Description: PGP signature
