]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
windows-callback-restore-multi-cell-servers-20071226
authorJeffrey Altman <jaltman@secure-endpoints.com>
Wed, 26 Dec 2007 16:18:37 +0000 (16:18 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Wed, 26 Dec 2007 16:18:37 +0000 (16:18 +0000)
LICENSE MIT

The case of openafs.org and grand.central.org is a hideous abuse of
the AFS cell name space.  There are many negatives associated with
trying to support two different cell names pointing at overlapping
vlserver lists:

(1) The CM can store duplicate entries for all of the data simply because
    the cell name that was used is different

(2) If the CM attempts to optimize the data storage by aliasing or otherwise
    combining the cell names as part of one cm_cell_t object, then future
    attempts to separate the two cell names will require the destruction
    of the cache.

(3) If the CM does not associate a callback revoke with a particular cell,
    then the status data associated with any entry that matches the revoked
    AFSFid will be discarded.  For volume callbacks this can have a serious
    impact because volume IDs are not unique across cells and discarding
    status data for readonly volumes that are in use can result in a
    significant number of FetchStatus requests being sent to the associated
    file server.

There are other issues as well involving authentication.

The case of openafs.org advertising the vlserver addresses of
grand.central.org should be considered a hack; a hack that the Windows
client will no longer ensure will work.

Additional debugging messages have been added to assist individuals attempting
to debug why callback revokes do not appear to take affect when two cell
names share the same vlserver data.

src/WINNT/afsd/cm_callback.c
src/WINNT/afsd/cm_cell.c

index d4d28ff80d1195f1cd7b3b16611456adef4f88ef..2212359c736cb009c649bfe1a0dc81e0348e0d16 100644 (file)
@@ -355,6 +355,7 @@ SRXAFSCB_CallBack(struct rx_call *callp, AFSCBFids *fidsArrayp, AFSCBs *cbsArray
     unsigned long host = 0;
     unsigned short port = 0;
     cm_server_t *tsp = NULL;
+    cm_cell_t* cellp = NULL;
 
     MUTEX_ENTER(&callp->lock);
 
@@ -362,9 +363,19 @@ SRXAFSCB_CallBack(struct rx_call *callp, AFSCBFids *fidsArrayp, AFSCBs *cbsArray
         host = rx_HostOf(peerp);
         port = rx_PortOf(peerp);
 
-        osi_Log2(afsd_logp, "SRXAFSCB_CallBack from host 0x%x port %d",
-                  ntohl(host),
-                  ntohs(port));
+        tsp = cm_FindServerByIP(host, CM_SERVER_FILE);
+        if (tsp)
+            cellp = tsp->cellp;
+
+        if (cellp)
+            osi_Log2(afsd_logp, "SRXAFSCB_CallBack from host 0x%x port %d",
+                     ntohl(host),
+                     ntohs(port));
+        else 
+            osi_Log3(afsd_logp, "SRXAFSCB_CallBack from host 0x%x port %d for cell %s",
+                     ntohl(host),
+                     ntohs(port),
+                     cellp->name /* does not need to be saved, doesn't change */);
     } else {
         osi_Log0(afsd_logp, "SRXAFSCB_CallBack from unknown host");
     }
@@ -376,9 +387,9 @@ SRXAFSCB_CallBack(struct rx_call *callp, AFSCBFids *fidsArrayp, AFSCBs *cbsArray
         if (tfidp->Volume == 0)
             continue;   /* means don't do anything */
         else if (tfidp->Vnode == 0)
-            cm_RevokeVolumeCallback(callp, NULL, tfidp);
+            cm_RevokeVolumeCallback(callp, cellp, tfidp);
         else
-            cm_RevokeCallback(callp, NULL, tfidp);
+            cm_RevokeCallback(callp, cellp, tfidp);
     }
 
     MUTEX_EXIT(&callp->lock);
index 345fc1f5b2742d68be0868f4e7d6935bc9982cdd..3904b1528b6138c83ee58e8c055d6ac2efd3b371 100644 (file)
@@ -24,7 +24,9 @@
 osi_rwlock_t cm_cellLock;
 
 /* function called as callback proc from cm_SearchCellFile.  Return 0 to
- * continue processing.
+ * continue processing.  
+ *
+ * At the present time the return value is ignored by the caller.
  */
 long cm_AddCellProc(void *rockp, struct sockaddr_in *addrp, char *namep)
 {
@@ -39,6 +41,10 @@ long cm_AddCellProc(void *rockp, struct sockaddr_in *addrp, char *namep)
     {
         if ( !tsp->cellp )
             tsp->cellp = cellp;
+        else if (tsp->cellp != cellp) {
+            osi_Log2(afsd_logp, "found a vlserver associated with two cell names %s and %s",
+                     osi_LogSaveString(afsd_logp,tsp->cellp->name), osi_LogSaveString(afsd_logp,cellp->name));
+        }
     }       
     else
         tsp = cm_NewServer(addrp, CM_SERVER_VLDB, cellp);
@@ -50,6 +56,7 @@ long cm_AddCellProc(void *rockp, struct sockaddr_in *addrp, char *namep)
     lock_ObtainWrite(&cm_serverLock);
     tsrp->refCount--;
     lock_ReleaseWrite(&cm_serverLock);
+
     return 0;
 }