OpenAFS Master Repository branch, master, updated. BP--openafs-stable-1_6_x-1358-g99b4327
Gerrit Code Review
gerrit@openafs.org
Sun, 10 Jul 2011 06:51:06 -0700 (PDT)
The following commit has been merged in the master branch:
commit 99b43273c0203881ea3d2d50f0abf000cdc0b03e
Author: Jeffrey Altman <jaltman@your-file-system.com>
Date: Sun Jul 10 03:43:45 2011 +0100
rx: prevent connection channel assignment race
When rx was converted to use pthreads, the code that allocates
a call to a connection channel in rxi_ReceivePacket() was not
made thread safe. The code prior to this patchset permitted a race
in the server connection case. The rx_connection channel assignment
in rxi_ReceivePacket() and the call destruction in rxi_FreeCall()
and rxi_DestroyConnectionNoLock() did not consistently protect the
rx_connection channel array using the conn_call_lock.
This race could result in rxi_ReceivePacket() operating on a
rx_call which was disconnected from the previously assigned
rx_connection.
In addition, the code in rxi_ReceivePacket() that was intended
to protect the allocation of a call using rxi_NewCall() to the
connection channel array was racy with itself.
This patchset consistently applies the conn_call_lock to protect
the allocation / deallocation of calls to the connection channel
array and in the process simplifies the logic in rxi_ReceivePacket()
as it is no longer necessary to protect against a null call pointer
since the race can no longer be lost.
Change-Id: Id61b55b4d1d57a2b9b35ea942545ef4bdc8d33f3
Reviewed-on: http://gerrit.openafs.org/4963
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/rx/rx.c | 172 ++++++++++++++++++++++++++---------------------------------
1 files changed, 76 insertions(+), 96 deletions(-)
--
OpenAFS Master Repository