]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE12-drop-h-lock-around-putconn-20041027
authorDerrick Brashear <shadow@dementia.org>
Thu, 28 Oct 2004 19:30:06 +0000 (19:30 +0000)
committerDerrick Brashear <shadow@dementia.org>
Thu, 28 Oct 2004 19:30:06 +0000 (19:30 +0000)
the problem with rx_PutConnection is h_FreeConnection uses the host global lock

====================
This delta was composed from multiple commits as part of the CVS->Git migration.
The checkin message with each commit was inconsistent.
The following are the additional commit messages.
====================

the problem with rx_PutConnection is h_FreeConnection uses the host global lock
but it shouldn't matter (callback conn should be a client not server conn and
thus not h_FreeConnection on cleanup)

further, we should free the conns we GetConnection'd not the ones still in
the host struct at the end.

(cherry picked from commit 2fbfef7f9157aad571307564faae1ce7aae4e3be)

src/viced/callback.c

index ff736600be3239e56380fef3a938dbd8f5f1a85e..594fd33380266811f2814a8301d11374fcccbb64 100644 (file)
@@ -844,12 +844,21 @@ static void MultiBreakCallBack_r(cba, ncbas, afidp, xhost)
     struct host *hp;
     hp = cba[i].hp;
     if (hp && xhost != hp) {
-      rx_PutConnection(hp->callback_rxcon);
       h_Release_r(hp);
     }
   }
 
-return ;
+  /* H_UNLOCK around this so h_FreeConnection does not deadlock.
+     h_FreeConnection should *never* be called on a callback connection,
+     but on 10/27/04 a deadlock occurred where it was, when we know why,
+     this should be reverted. -- shadow */
+  H_UNLOCK;
+  for (i = 0; i < j; i++) {
+      rx_PutConnection(conns[i]);
+  }
+  H_LOCK;
+
+  return ;
 }
 
 /*