OpenAFS Master Repository branch, openafs-stable-1_6_x, updated. openafs-stable-1_6_0pre6-59-g8ecd684
Gerrit Code Review
gerrit@openafs.org
Tue, 12 Jul 2011 21:30:08 -0700 (PDT)
The following commit has been merged in the openafs-stable-1_6_x branch:
commit 8ecd684a33817e94c9671238565a755e5818e753
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.
(cherry picked from commit 99b43273c0203881ea3d2d50f0abf000cdc0b03e)
Reviewed-on: http://gerrit.openafs.org/4963
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Change-Id: I90ad0dc1f67df2bcaca1da0bb459e730541876cb
Reviewed-on: http://gerrit.openafs.org/4981
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/rx/rx.c | 171 ++++++++++++++++++++++++++---------------------------------
1 files changed, 76 insertions(+), 95 deletions(-)
--
OpenAFS Master Repository