libafs: Get rx conn ref with afs conn ref
When we get a reference to an afs_conn with afs_Conn and its variants,
we assume we can use the tc->id rx connection without holding any
locks. However, if tc->forceConnectFS gets set, the tc->id connection
can be destroyed and recreated out from under us. So, to avoid using a
possibly freed rx connection, grab a reference to the rx connection at
the same time as we grab a reference to the afs conn. And also put
back the same reference with afs_PutConn.
Reviewed-on: http://gerrit.openafs.org/4625
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
03f0c656c1734b9be4debdf19b8f10771ff4420a)
Change-Id: I5bef36da0a4337d923a68f1d352b4aad1143395a
Reviewed-on: http://gerrit.openafs.org/4648
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>