cvs commit: src/sys/netinet6 in6_src.c
Hajimu UMEMOTO
ume at FreeBSD.org
Wed Aug 17 17:47:08 GMT 2005
Hi,
>>>>> On Wed, 17 Aug 2005 13:18:25 -0400
>>>>> John Baldwin <jhb at FreeBSD.org> said:
jhb> Thanks. I see that you still kept the mutex and and properly lock both the sx
jhb> and mutex when making updates, so it seems it is on purpose. The one place
jhb> that doesn't use the sx lock is lookup_addrsel_policy() which is called from
jhb> in6_selectsrc(). I guess it is not ok to sleep in that function and that is
jhb> why you don't use the sx lock in that one place?
Because, lookup_addrsel_policy() is protected by mutex lock.
add_addrsel_policyent() and delete_addrsel_policyent() do update the
tailq. Both of the two functions are also protected by mutex. So, I
tought that lookup_addrsel_policy() doesn't need sx lock.
I tried to stop using of mutex locks and used only sx locks, as learn
by mistake. It ended up with exclusive lock error between INP_LOCK.
So, I avoided to use sx lock in lookup_addrsel_policy().
Am I something wrong?
Sincerely,
--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
ume at mahoroba.org ume@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/
More information about the cvs-all
mailing list