Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Aug 2005 02:46:40 +0900
From:      Hajimu UMEMOTO <ume@FreeBSD.org>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/netinet6 in6_src.c
Message-ID:  <yger7csmp6n.wl%ume@mahoroba.org>
In-Reply-To: <200508171318.27652.jhb@FreeBSD.org>
References:  <200508161949.j7GJnAaG015685@repoman.freebsd.org> <200508161559.24097.jhb@FreeBSD.org> <ygevf24mruo.wl%ume@mahoroba.org> <200508171318.27652.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

>>>>> On Wed, 17 Aug 2005 13:18:25 -0400
>>>>> John Baldwin <jhb@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@mahoroba.org  ume@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?yger7csmp6n.wl%ume>