[illumos-Developer] webrev for 1107
Dan Kruchinin
dkruchinin at acm.org
Mon Jun 13 11:17:02 PDT 2011
On Mon, Jun 13, 2011 at 9:53 PM, Vitaliy Gusev
<gusev.vitaliy at nexenta.com> wrote:
> On 06/13/2011 09:35 PM, Dan Kruchinin wrote:
>>>
>>> Connection oriented protocols are initialized via cots_listen_event()
>>> that
>>> is called from poll_for_action().
>>
>> poll_for_action() doesn't call any initialization functions, it just
>> does polling on
>> fds that were registered earlier
>> (via do_one calling do_poll_cots_actions which in its turn calls
>> cots_listen_events).
>> So cots_listen_events that initializes connection oriented protocols
>> is called from
>> only one function - do_one().
>
> No, do_one doesn't call do_poll_cots_action. I as mentioned early,
> call stack is:
>
> poll_for_action
> do_poll_cots_action
> cots_listen_event
Heh, your're right, I confused poll_for_actions with add_to_poll_list,
which is called by do_one.
But your point point opens several questions. First of all I need to
explain why we need OK_TPI_TYPE
instead of checking of nc_semantics on NC_TPI_CLTS only.
Both nfsd and lockd calls do_one function and pass svc callback to it.
In case of lockd svc callback
is nlmsvc function which calls LM_SVC nfs syscall that opens in its
turn makes kernel to register
kRPC server handles for given protocols and devices. By some reason
original version of do_one function
calls svc callback only for CLTS nc_semantics, thus callback won't be
called for all providers with COTS
semantic. In this case lockd won't register /dev/ticotsord kRPC
service for communication with lockd,
because ticotsord is COTS only.
In case of nfsd do_one function calls nfssvc callback for CLTS only.
nfssvc calls NFS_SVC nfssys
that in its turn creates kRPC server handle. According to the code,
nfs_tbind.c will create only CLTS
kRPC server handles for nfsd. Is it right?
>
>
> Each daemons should go to poll_for_action() loop.
>
>
> Also see add_to_poll_list(sock, retnconf);
>
>>
>>>
>>>
>>> So, Dan, Why did you change it with OK_TPI_TYPE?
>>>
>>> - if (retnconf->nc_semantics == NC_TPI_CLTS) {
>>> + if (OK_TPI_TYPE(retnconf)) {
>>>
>>>
>>> It needs to be initialized directly only for connectionless protocols
>>> (UDP).
>>
>> This change was done in do_one function that _must_ work with both
>> COTS and CLTS, right?
>
> do_one now works with both COTS and CLTS protocols.
>
>
>> do_one function is main entry point for NFS related daemons which want
>> to initialize server code
>> for particular protocol and do polling on related devices then.
>> Actually there is another entry point
>> called do_all(), but it calls do_one as well.
>>
>>>
>>>
>>>> Would be good to understand why that was there.
>>>>
>>>> On Sun, Jun 12, 2011 at 10:31 PM, Dan Kruchinin<dkruchinin at acm.org>
>>>> wrote:
>>>>>
>>>>> While working on NFS lock manager I found two bugs/issues in illumos.
>>>>> Here is the first one.
>>>>> The patch makes do_one() function of nfs_tbind.c able to work with
>>>>> loopback device (/dev/ticotsord) provider.
>>>>> We need it for lockd daemon. It uses loopback device to communicate
>>>>> with kernel part of network lock manager.
>>>>
>>>> BTW, it's used by the in-kernel part of the lock manager to
>>>> communicate with the user-space NFS status monitor.
>>>> (This code pre-dates doors, door up-calls, etc.) We could
>>>> change it use a different mechanism, but we'd prefer to
>>>> minimize the scope of this work as much as possible.
>>>> (At least for now.)
>>>>
>>>> Gordon
>>>>
>>>> _______________________________________________
>>>> Developer mailing list
>>>> Developer at lists.illumos.org
>>>> http://lists.illumos.org/m/listinfo/developer
>>>
>>>
>>
>>
>>
>
>
--
W.B.R.
Dan Kruchinin
More information about the Developer
mailing list