cvs commit: src/sys/kern link_elf.c link_elf_obj.c

Kostik Belousov kostikbel at gmail.com
Mon Aug 4 14:16:14 UTC 2008


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-all/attachments/20080804/8e3ed29b/attachment.pgp


More information about the cvs-all mailing list