Rx: make conn_call_lock and conn_data_lock usage consistent
authorJeffrey Altman <jaltman@your-file-system.com>
Sat, 17 Apr 2010 02:42:34 +0000 (22:42 -0400)
committerDerrick Brashear <shadow@dementia.org>
Sat, 17 Apr 2010 14:09:29 +0000 (07:09 -0700)
commit3ad9c5583845986979a25d615a9640770a3bf9f6
treef540d94400846ae87549195f70b1d70287fef7d1
parentf6d2a279b9f4899f2ab072d949f0d4ff11a517f6
Rx: make conn_call_lock and conn_data_lock usage consistent

The rx_connection.flags field is protected by the conn_data_lock
but the conn_data_lock is not held everywhere the conn flags
field is altered.  This produces a race that can result in a
deadlock when waiter flags are inadvertently prevented from being
cleared.

The conn_call_lock usage in rx_EndCall which was removed in
Change e169708681eb1bbbb31951b95f68e861a4b01c7e must be restored.
If rx_EndCall never obtains the conn_call_lock it can't ensure
that the thread in rx_NewCall actively checking the calls will
not end up blocking when there is now a call channel that can
be reused.  This usage of conn_call_lock can be removed only
if a true producer/consumer model is implemented.

Change-Id: Id093fd6c4a42afb833c775411be0cd406abf4ef7
Reviewed-on: http://gerrit.openafs.org/1766
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
src/rx/rx.c
src/rx/rx.h