Index: openafs/src/WINNT/afsd/afsd_init.c
diff -c openafs/src/WINNT/afsd/afsd_init.c:1.40.2.21 openafs/src/WINNT/afsd/afsd_init.c:1.40.2.23
*** openafs/src/WINNT/afsd/afsd_init.c:1.40.2.21	Thu Aug  4 12:06:37 2005
--- openafs/src/WINNT/afsd/afsd_init.c	Sat Aug 27 23:45:15 2005
***************
*** 638,644 ****
      dummyLen = sizeof(TraceOption);
      code = RegQueryValueEx(parmKey, "TraceOption", NULL, NULL,
                              (BYTE *) &TraceOption, &dummyLen);
!     afsi_log("Event Log Tracing = %lX", TraceOption);
  
      dummyLen = sizeof(traceBufSize);
      code = RegQueryValueEx(parmKey, "TraceBufferSize", NULL, NULL,
--- 638,644 ----
      dummyLen = sizeof(TraceOption);
      code = RegQueryValueEx(parmKey, "TraceOption", NULL, NULL,
                              (BYTE *) &TraceOption, &dummyLen);
!     afsi_log("Trace Options = %lX", TraceOption);
  
      dummyLen = sizeof(traceBufSize);
      code = RegQueryValueEx(parmKey, "TraceBufferSize", NULL, NULL,
***************
*** 653,659 ****
      /* setup and enable debug log */
      afsd_logp = osi_LogCreate("afsd", traceBufSize);
      afsi_log("osi_LogCreate log addr %x", (int)afsd_logp);
!     osi_LogEnable(afsd_logp);
      logReady = 1;
  
      osi_Log0(afsd_logp, "Log init");
--- 653,665 ----
      /* setup and enable debug log */
      afsd_logp = osi_LogCreate("afsd", traceBufSize);
      afsi_log("osi_LogCreate log addr %x", (int)afsd_logp);
!     if ((TraceOption & 0x8)
! #ifdef DEBUG
! 	 || 1
! #endif
! 	 ) {
! 	osi_LogEnable(afsd_logp);
!     }
      logReady = 1;
  
      osi_Log0(afsd_logp, "Log init");
Index: openafs/src/WINNT/afsd/cm_buf.c
diff -c openafs/src/WINNT/afsd/cm_buf.c:1.13.2.12 openafs/src/WINNT/afsd/cm_buf.c:1.13.2.14
*** openafs/src/WINNT/afsd/cm_buf.c:1.13.2.12	Fri Aug  5 20:36:11 2005
--- openafs/src/WINNT/afsd/cm_buf.c	Sat Aug 27 23:30:57 2005
***************
*** 19,24 ****
--- 19,25 ----
  #include <stdio.h>
  #include <assert.h>
  #include <strsafe.h>
+ #include <math.h>
  
  #include "afsd.h"
  #include "cm_memmap.h"
***************
*** 109,115 ****
      bp = cm_data.buf_allp;
      bp->refCount++;
      lock_ReleaseWrite(&buf_globalLock);
!     nAtOnce = cm_data.buf_nbuffers / 10;
      while (buf_ShutdownFlag == 0) {
  #ifndef DJGPP
          i = SleepEx(5000, 1);
--- 110,116 ----
      bp = cm_data.buf_allp;
      bp->refCount++;
      lock_ReleaseWrite(&buf_globalLock);
!     nAtOnce = (long)sqrt(cm_data.buf_nbuffers);
      while (buf_ShutdownFlag == 0) {
  #ifndef DJGPP
          i = SleepEx(5000, 1);
***************
*** 434,440 ****
  }
  
  /* wait for reading or writing to clear; called with write-locked
!  * buffer, and returns with locked buffer.
   */
  void buf_WaitIO(cm_scache_t * scp, cm_buf_t *bp)
  {
--- 435,441 ----
  }
  
  /* wait for reading or writing to clear; called with write-locked
!  * buffer and unlocked scp and returns with locked buffer.
   */
  void buf_WaitIO(cm_scache_t * scp, cm_buf_t *bp)
  {
***************
*** 454,468 ****
          if ( bp->flags & CM_BUF_WAITING ) {
              bp->waitCount++;
              bp->waitRequests++;
!             osi_Log1(buf_logp, "buf_WaitIO CM_BUF_WAITING already set for 0x%x", bp);
          } else {
!             osi_Log1(buf_logp, "buf_WaitIO CM_BUF_WAITING set for 0x%x", bp);
              bp->flags |= CM_BUF_WAITING;
              bp->waitCount = bp->waitRequests = 1;
          }
          osi_SleepM((long) bp, &bp->mx);
          lock_ObtainMutex(&bp->mx);
!         osi_Log1(buf_logp, "buf_WaitIO conflict wait done for 0x%x", bp);
          bp->waitCount--;
          if (bp->waitCount == 0) {
              osi_Log1(afsd_logp, "buf_WaitIO CM_BUF_WAITING reset for 0x%x", bp);
--- 455,469 ----
          if ( bp->flags & CM_BUF_WAITING ) {
              bp->waitCount++;
              bp->waitRequests++;
!             osi_Log1(afsd_logp, "buf_WaitIO CM_BUF_WAITING already set for 0x%x", bp);
          } else {
!             osi_Log1(afsd_logp, "buf_WaitIO CM_BUF_WAITING set for 0x%x", bp);
              bp->flags |= CM_BUF_WAITING;
              bp->waitCount = bp->waitRequests = 1;
          }
          osi_SleepM((long) bp, &bp->mx);
          lock_ObtainMutex(&bp->mx);
!         osi_Log1(afsd_logp, "buf_WaitIO conflict wait done for 0x%x", bp);
          bp->waitCount--;
          if (bp->waitCount == 0) {
              osi_Log1(afsd_logp, "buf_WaitIO CM_BUF_WAITING reset for 0x%x", bp);
***************
*** 476,485 ****
          if ( scp ) {
              lock_ObtainMutex(&scp->mx);
              if (scp->flags & CM_SCACHEFLAG_WAITING) {
!                 osi_Log1(buf_logp, "buf_WaitIO waking scp 0x%x", scp);
                  osi_Wakeup((long)&scp->flags);
-                 lock_ReleaseMutex(&scp->mx);
              }
          }
      }
          
--- 477,486 ----
          if ( scp ) {
              lock_ObtainMutex(&scp->mx);
              if (scp->flags & CM_SCACHEFLAG_WAITING) {
!                 osi_Log1(afsd_logp, "buf_WaitIO waking scp 0x%x", scp);
                  osi_Wakeup((long)&scp->flags);
              }
+ 	    lock_ReleaseMutex(&scp->mx);
          }
      }
          
***************
*** 487,496 ****
       * the I/O to complete.  Do so.
       */
      if (bp->flags & CM_BUF_WAITING) {
!         osi_Log1(buf_logp, "buf_WaitIO Waking bp 0x%x", bp);
          osi_Wakeup((long) bp);
      }
!     osi_Log1(buf_logp, "WaitIO finished wait for bp 0x%x", (long) bp);
  }
  
  /* code to drop reference count while holding buf_globalLock */
--- 488,497 ----
       * the I/O to complete.  Do so.
       */
      if (bp->flags & CM_BUF_WAITING) {
!         osi_Log1(afsd_logp, "buf_WaitIO Waking bp 0x%x", bp);
          osi_Wakeup((long) bp);
      }
!     osi_Log1(afsd_logp, "WaitIO finished wait for bp 0x%x", (long) bp);
  }
  
  /* code to drop reference count while holding buf_globalLock */
***************
*** 562,570 ****
--- 563,573 ----
      while ((bp->flags & CM_BUF_DIRTY) == CM_BUF_DIRTY) {
          lock_ReleaseMutex(&bp->mx);
  
+ 	osi_Log1(afsd_logp, "buf_LockedCleanAsync starts I/O on 0x%x", bp);
          code = (*cm_buf_opsp->Writep)(&bp->fid, &bp->offset,
                                         cm_data.buf_blockSize, 0, bp->userp,
                                         reqp);
+ 	osi_Log2(afsd_logp, "buf_LockedCleanAsync I/O on 0x%x, done=%d", bp, code);
                  
          lock_ObtainMutex(&bp->mx);
          if (code) 
***************
*** 578,584 ****
      };
  
      /* do logging after call to GetLastError, or else */
-     osi_Log2(buf_logp, "buf_CleanAsync starts I/O on 0x%x, done=%d", bp, code);
          
      /* if someone was waiting for the I/O that just completed or failed,
       * wake them up.
--- 581,586 ----
Index: openafs/src/WINNT/afsd/cm_dcache.c
diff -c openafs/src/WINNT/afsd/cm_dcache.c:1.11.2.13 openafs/src/WINNT/afsd/cm_dcache.c:1.11.2.14
*** openafs/src/WINNT/afsd/cm_dcache.c:1.11.2.13	Sun Jun 12 07:45:49 2005
--- openafs/src/WINNT/afsd/cm_dcache.c	Sat Aug 27 23:30:58 2005
***************
*** 134,141 ****
          callp = rx_NewCall(rxconnp);
          rx_PutConnection(rxconnp);
  
!         osi_Log3(afsd_logp, "CALL StoreData scp 0x%x, off 0x%x, size 0x%x",
!                  (long) scp, biod.offset.LowPart, nbytes);
  
          code = StartRXAFS_StoreData(callp, &tfid, &inStatus,
                                      biod.offset.LowPart, nbytes, truncPos);
--- 134,141 ----
          callp = rx_NewCall(rxconnp);
          rx_PutConnection(rxconnp);
  
!         osi_Log4(afsd_logp, "CALL StoreData scp 0x%x, offset 0x%x:%08x, length 0x%x",
!                  (long) scp, biod.offset.HighPart, biod.offset.LowPart, nbytes);
  
          code = StartRXAFS_StoreData(callp, &tfid, &inStatus,
                                      biod.offset.LowPart, nbytes, truncPos);
***************
*** 158,179 ****
                  /* write out wbytes of data from bufferp */
                  temp = rx_Write(callp, bufferp, wbytes);
                  if (temp != wbytes) {
!                     osi_Log2(afsd_logp, "rx_Write failed %d != %d",temp,wbytes);
                      code = -1;
                      break;
                  } else {
!                     osi_Log1(afsd_logp, "rx_Write succeeded %d",temp);
                  }       
                  nbytes -= wbytes;
              }	/* while more bytes to write */
          }		/* if RPC started successfully */
          else {
!             osi_Log1(afsd_logp, "StartRXAFS_StoreData failed (%lX)",code);
          }
          if (code == 0) {
              code = EndRXAFS_StoreData(callp, &outStatus, &volSync);
              if (code)
!                 osi_Log1(afsd_logp, "EndRXAFS_StoreData failed (%lX)",code);
          }
          code = rx_EndCall(callp, code);
                  
--- 158,179 ----
                  /* write out wbytes of data from bufferp */
                  temp = rx_Write(callp, bufferp, wbytes);
                  if (temp != wbytes) {
!                     osi_Log3(afsd_logp, "rx_Write failed bp 0x%x, %d != %d",bufp,temp,wbytes);
                      code = -1;
                      break;
                  } else {
!                     osi_Log2(afsd_logp, "rx_Write succeeded bp 0x%x, %d",bufp,temp);
                  }       
                  nbytes -= wbytes;
              }	/* while more bytes to write */
          }		/* if RPC started successfully */
          else {
!             osi_Log2(afsd_logp, "StartRXAFS_StoreData scp 0x%x failed (%lX)",scp,code);
          }
          if (code == 0) {
              code = EndRXAFS_StoreData(callp, &outStatus, &volSync);
              if (code)
!                 osi_Log2(afsd_logp, "EndRXAFS_StoreData scp 0x%x failed (%lX)",scp,code);
          }
          code = rx_EndCall(callp, code);
                  
***************
*** 181,189 ****
      code = cm_MapRPCError(code, reqp);
          
      if (code)
!         osi_Log1(afsd_logp, "CALL StoreData FAILURE, code 0x%x", code);
      else
!         osi_Log0(afsd_logp, "CALL StoreData SUCCESS");
  
      /* now, clean up our state */
      lock_ObtainMutex(&scp->mx);
--- 181,189 ----
      code = cm_MapRPCError(code, reqp);
          
      if (code)
!         osi_Log2(afsd_logp, "CALL StoreData FAILURE scp 0x%x, code 0x%x", scp, code);
      else
!         osi_Log1(afsd_logp, "CALL StoreData SUCCESS scp 0x%x", scp);
  
      /* now, clean up our state */
      lock_ObtainMutex(&scp->mx);
***************
*** 492,498 ****
      toffset.HighPart = p2;
      length = p3;
  
!     osi_Log2(afsd_logp, "Starting BKG store vp 0x%x, base 0x%x", scp, p1);
  
      cm_BufWrite(&scp->fid, &toffset, length, /* flags */ 0, userp, &req);
  
--- 492,498 ----
      toffset.HighPart = p2;
      length = p3;
  
!     osi_Log4(afsd_logp, "Starting BKG store scp 0x%x, offset 0x%x:%08x, length 0x%x", scp, p2, p1, p3);
  
      cm_BufWrite(&scp->fid, &toffset, length, /* flags */ 0, userp, &req);
  
***************
*** 536,542 ****
      base.HighPart = p2;
      length = p3;
          
!     osi_Log2(afsd_logp, "Starting BKG prefetch vp 0x%x, base 0x%x", scp, p1);
  
      code = buf_Get(scp, &base, &bp);
  
--- 536,542 ----
      base.HighPart = p2;
      length = p3;
          
!     osi_Log2(afsd_logp, "Starting BKG prefetch scp 0x%x, base 0x%x", scp, p1);
  
      code = buf_Get(scp, &base, &bp);
  
***************
*** 1093,1099 ****
          /* turn off writing and wakeup users */
          if (isStore) {
              if (bufp->flags & CM_BUF_WAITING) {
!                 osi_Log1(afsd_logp, "cm_ReleaseBIOD Waking bp 0x%x", bufp);
                  osi_Wakeup((long) bufp);
              }
              bufp->flags &= ~(CM_BUF_WRITING | CM_BUF_DIRTY);
--- 1093,1099 ----
          /* turn off writing and wakeup users */
          if (isStore) {
              if (bufp->flags & CM_BUF_WAITING) {
!                 osi_Log2(afsd_logp, "cm_ReleaseBIOD Waking [scp 0x%x] bp 0x%x", scp, bufp);
                  osi_Wakeup((long) bufp);
              }
              bufp->flags &= ~(CM_BUF_WRITING | CM_BUF_DIRTY);
Index: openafs/src/WINNT/client_osi/osibasel.c
diff -c openafs/src/WINNT/client_osi/osibasel.c:1.2 openafs/src/WINNT/client_osi/osibasel.c:1.2.2.1
*** openafs/src/WINNT/client_osi/osibasel.c:1.2	Sun Mar  9 20:59:15 2003
--- openafs/src/WINNT/client_osi/osibasel.c	Sat Aug 27 23:33:24 2005
***************
*** 192,197 ****
--- 192,198 ----
  		/* if we're here, all clear to set the lock */
  		lockp->flags |= OSI_LOCKFLAG_EXCL;
  	}
+         lockp->tid = thrd_Current();
  	LeaveCriticalSection(csp);
  }
  
***************
*** 212,217 ****
--- 213,219 ----
  	osi_assertx(lockp->flags & OSI_LOCKFLAG_EXCL, "mutex not held");
  	
  	lockp->flags &= ~OSI_LOCKFLAG_EXCL;
+         lockp->tid = 0;
  	if (!osi_TEmpty(&lockp->d.turn)) {
  		osi_TSignalForMLs(&lockp->d.turn, 0, csp);
  	}
***************
*** 411,416 ****
--- 413,419 ----
  	 */
  	mp->type = 0;
  	mp->flags = 0;
+         mp->tid = 0;
  	mp->atomicIndex = osi_MUTEXHASH(mp);
          osi_TInit(&mp->d.turn);
  	return;
Index: openafs/src/WINNT/client_osi/osibasel.h
diff -c openafs/src/WINNT/client_osi/osibasel.h:1.2 openafs/src/WINNT/client_osi/osibasel.h:1.2.2.1
*** openafs/src/WINNT/client_osi/osibasel.h:1.2	Sun Mar  9 20:59:15 2003
--- openafs/src/WINNT/client_osi/osibasel.h	Sat Aug 27 23:33:24 2005
***************
*** 31,36 ****
--- 31,37 ----
  	char type;			/* for all types; type 0 uses atomic count */
  	char flags;			/* flags for base type */
  	unsigned short atomicIndex;	/* index of lock for low-level sync */
+         thread_t tid;			/* tid of thread that owns the lock */
  	unsigned short waiters;		/* waiters */
          unsigned short pad;
  	union {
Index: openafs/src/WINNT/client_osi/osilog.c
diff -c openafs/src/WINNT/client_osi/osilog.c:1.8.2.1 openafs/src/WINNT/client_osi/osilog.c:1.8.2.2
*** openafs/src/WINNT/client_osi/osilog.c:1.8.2.1	Fri Mar 11 02:00:28 2005
--- openafs/src/WINNT/client_osi/osilog.c	Fri Aug 26 09:48:48 2005
***************
*** 37,42 ****
--- 37,50 ----
  unsigned long osi_logFreq;	/* 0, or frequency of high perf counter */
  unsigned long osi_logTixToMicros;	/* mult. correction factor */
  
+ #define TRACE_OPTION_EVENT 2
+ #define TRACE_OPTION_DEBUGLOG 4
+ 
+ #define ISCLIENTTRACE(v) ( ((v) & TRACE_OPTION_EVENT)==TRACE_OPTION_EVENT)
+ #define ISCLIENTDEBUGLOG(v) (((v) & TRACE_OPTION_DEBUGLOG)==TRACE_OPTION_DEBUGLOG)
+ 
+ DWORD osi_TraceOption=0;
+ 
  osi_fdOps_t osi_logFDOps = {
  	osi_LogFDCreate,
  #ifndef DJGPP
***************
*** 94,102 ****
          logp->datap = malloc(size * sizeof(osi_logEntry_t));
  
  	/* init strings array */
! 	logp->maxstringindex = size/5;
  	logp->stringindex = 0;
! 	logp->stringsp = malloc((size/5) * OSI_LOG_STRINGSIZE);
   
          /* and sync */
          thrd_InitCrit(&logp->cs);
--- 102,110 ----
          logp->datap = malloc(size * sizeof(osi_logEntry_t));
  
  	/* init strings array */
! 	logp->maxstringindex = size/3;
  	logp->stringindex = 0;
! 	logp->stringsp = malloc(logp->maxstringindex * OSI_LOG_STRINGSIZE);
   
          /* and sync */
          thrd_InitCrit(&logp->cs);
***************
*** 208,224 ****
          lep->parms[3] = p3;
  
  #ifdef NOTSERVICE
! 		printf( "%9ld:", lep->micros );
! 		printf( formatp, p0, p1, p2, p3);
! 		printf( "\n" );
  #endif
  
  	thrd_LeaveCrit(&logp->cs);
  }
  
  void osi_LogPrint(osi_log_t *logp, FILE_HANDLE handle)
  {
! 	char wholemsg[1000], msg[1000];
  	int i, ix, ioCount;
  	osi_logEntry_t *lep;
  
--- 216,243 ----
          lep->parms[3] = p3;
  
  #ifdef NOTSERVICE
!         printf( "%9ld:", lep->micros );
!         printf( formatp, p0, p1, p2, p3);
!         printf( "\n" );
  #endif
  
+         if(ISCLIENTDEBUGLOG(osi_TraceOption)) {
+ 	    char wholemsg[1024], msg[1000];
+ 
+ 	    snprintf(msg, sizeof(msg), formatp,
+ 		     p0, p1, p2, p3);
+ 	    snprintf(wholemsg, sizeof(wholemsg), 
+ 		     "tid[%d] %s\n",
+ 		     lep->tid, msg);
+             OutputDebugStringA(wholemsg);
+         }
+ 
  	thrd_LeaveCrit(&logp->cs);
  }
  
  void osi_LogPrint(osi_log_t *logp, FILE_HANDLE handle)
  {
! 	char wholemsg[1024], msg[1000];
  	int i, ix, ioCount;
  	osi_logEntry_t *lep;
  
***************
*** 230,239 ****
  	     i < logp->nused;
  	     i++, ix++, (ix >= logp->alloc ? ix -= logp->alloc : 0)) {
  		lep = logp->datap + ix;		/* pointer arithmetic */
! 		sprintf(msg, lep->formatp,
  			lep->parms[0], lep->parms[1],
  			lep->parms[2], lep->parms[3]);
! 		sprintf(wholemsg, "time %d.%06d, pid %d %s\n",
  			lep->micros / 1000000,
  			lep->micros % 1000000,
  			lep->tid, msg);
--- 249,259 ----
  	     i < logp->nused;
  	     i++, ix++, (ix >= logp->alloc ? ix -= logp->alloc : 0)) {
  		lep = logp->datap + ix;		/* pointer arithmetic */
! 		snprintf(msg, sizeof(msg), lep->formatp,
  			lep->parms[0], lep->parms[1],
  			lep->parms[2], lep->parms[3]);
! 		snprintf(wholemsg, sizeof(wholemsg),
! 			 "time %d.%06d, tid %d %s\n",
  			lep->micros / 1000000,
  			lep->micros % 1000000,
  			lep->tid, msg);
***************
*** 251,269 ****
  
  char *osi_LogSaveString(osi_log_t *logp, char *s)
  {
! 	char *saveplace = logp->stringsp[logp->stringindex];
  
  	if (s == NULL) return NULL;
  
  	if (strlen(s) >= OSI_LOG_STRINGSIZE)
  		sprintf(saveplace, "...%s",
  			s + strlen(s) - (OSI_LOG_STRINGSIZE - 4));
  	else
  		strcpy(saveplace, s);
  	logp->stringindex++;
  	if (logp->stringindex >= logp->maxstringindex)
  	    logp->stringindex = 0;
  
  	return saveplace;
  }
  
--- 271,296 ----
  
  char *osi_LogSaveString(osi_log_t *logp, char *s)
  {
! 	char *saveplace;
  
  	if (s == NULL) return NULL;
  
+         thrd_EnterCrit(&logp->cs);
+ 
+         saveplace = logp->stringsp[logp->stringindex];
+ 
  	if (strlen(s) >= OSI_LOG_STRINGSIZE)
  		sprintf(saveplace, "...%s",
  			s + strlen(s) - (OSI_LOG_STRINGSIZE - 4));
  	else
  		strcpy(saveplace, s);
  	logp->stringindex++;
+ 
  	if (logp->stringindex >= logp->maxstringindex)
  	    logp->stringindex = 0;
  
+         thrd_LeaveCrit(&logp->cs);
+ 
  	return saveplace;
  }
  
***************
*** 342,352 ****
  		logp->enabled = 0;
  }
  
- #define TRACE_OPTION_EVENT 2
- #define ISCLIENTTRACE(v) ( ((v) & TRACE_OPTION_EVENT)==TRACE_OPTION_EVENT)
- 
- DWORD osi_TraceOption=0;
- 
  void osi_InitTraceOption()
  {
  	DWORD LSPtype, LSPsize;
--- 369,374 ----
Index: openafs/src/WINNT/client_osi/osilog.h
diff -c openafs/src/WINNT/client_osi/osilog.h:1.5 openafs/src/WINNT/client_osi/osilog.h:1.5.2.1
*** openafs/src/WINNT/client_osi/osilog.h:1.5	Sat Jul 31 20:19:08 2004
--- openafs/src/WINNT/client_osi/osilog.h	Fri Aug 26 09:48:48 2005
***************
*** 91,96 ****
--- 91,97 ----
  #define osi_Log2(l,f,a,b)	osi_LogAdd((l), (f), (long) (a), (long) (b), 0, 0)
  #define osi_Log3(l,f,a,b,c)	osi_LogAdd((l), (f), (long) (a), (long) (b), (long) (c), 0)
  #define osi_Log4(l,f,a,b,c,d)	osi_LogAdd((l), (f), (long) (a), (long) (b), (long) (c), (long) (d))
+ #define osi_Log5(l,f,a,b,c,d,e)	osi_LogAdd((l), (f), (long) (a), (long) (b), (long) (c), (long) (d), (long) (e))
  
  #ifdef DEBUG_VERBOSE
  #define DEBUG_EVENT1(a,b,c) {HANDLE h; char *ptbuf[1],buf[132];\
Index: openafs/src/config/NTMakefile.amd64_w2k
diff -c openafs/src/config/NTMakefile.amd64_w2k:1.1.2.13 openafs/src/config/NTMakefile.amd64_w2k:1.1.2.14
*** openafs/src/config/NTMakefile.amd64_w2k:1.1.2.13	Wed Aug 17 06:24:36 2005
--- openafs/src/config/NTMakefile.amd64_w2k	Sat Aug 27 23:47:13 2005
***************
*** 80,86 ****
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=4
! AFSPRODUCT_VER_PATCH=0000
  AFSPRODUCT_VER_BUILD=0
  
  # For MSI installer, each major release should have a different GUID
--- 80,86 ----
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=4
! AFSPRODUCT_VER_PATCH=0001
  AFSPRODUCT_VER_BUILD=0
  
  # For MSI installer, each major release should have a different GUID
Index: openafs/src/config/NTMakefile.i386_nt40
diff -c openafs/src/config/NTMakefile.i386_nt40:1.46.2.28 openafs/src/config/NTMakefile.i386_nt40:1.46.2.29
*** openafs/src/config/NTMakefile.i386_nt40:1.46.2.28	Wed Aug 17 06:24:36 2005
--- openafs/src/config/NTMakefile.i386_nt40	Sat Aug 27 23:47:13 2005
***************
*** 80,86 ****
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=4
! AFSPRODUCT_VER_PATCH=0000
  AFSPRODUCT_VER_BUILD=0
  
  # For MSI installer, each major release should have a different GUID
--- 80,86 ----
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=4
! AFSPRODUCT_VER_PATCH=0001
  AFSPRODUCT_VER_BUILD=0
  
  # For MSI installer, each major release should have a different GUID
Index: openafs/src/config/NTMakefile.i386_w2k
diff -c openafs/src/config/NTMakefile.i386_w2k:1.1.2.13 openafs/src/config/NTMakefile.i386_w2k:1.1.2.14
*** openafs/src/config/NTMakefile.i386_w2k:1.1.2.13	Wed Aug 17 06:24:36 2005
--- openafs/src/config/NTMakefile.i386_w2k	Sat Aug 27 23:47:13 2005
***************
*** 80,86 ****
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=4
! AFSPRODUCT_VER_PATCH=0000
  AFSPRODUCT_VER_BUILD=0
  
  # For MSI installer, each major release should have a different GUID
--- 80,86 ----
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=4
! AFSPRODUCT_VER_PATCH=0001
  AFSPRODUCT_VER_BUILD=0
  
  # For MSI installer, each major release should have a different GUID
Index: openafs/src/packaging/MacOS/OpenAFS.info
diff -c openafs/src/packaging/MacOS/OpenAFS.info:1.1.4.15 openafs/src/packaging/MacOS/OpenAFS.info:1.1.4.16
*** openafs/src/packaging/MacOS/OpenAFS.info:1.1.4.15	Fri Aug 19 11:52:56 2005
--- openafs/src/packaging/MacOS/OpenAFS.info	Sun Aug 28 16:55:26 2005
***************
*** 1,5 ****
  Title OpenAFS
! Version 1.4.0-rc1
  Description The OpenAFS distributed filesystem. This package installs an almost-ready-to-run client for OpenAFS. see http://www.openafs.org for more information.
  DefaultLocation /
  Diskname (null)
--- 1,5 ----
  Title OpenAFS
! Version 1.4.0-rc2
  Description The OpenAFS distributed filesystem. This package installs an almost-ready-to-run client for OpenAFS. see http://www.openafs.org for more information.
  DefaultLocation /
  Diskname (null)
Index: openafs/src/rx/rx.c
diff -c openafs/src/rx/rx.c:1.58.2.20 openafs/src/rx/rx.c:1.58.2.21
*** openafs/src/rx/rx.c:1.58.2.20	Mon May 30 00:57:36 2005
--- openafs/src/rx/rx.c	Sun Aug 28 16:43:36 2005
***************
*** 17,23 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx.c,v 1.58.2.20 2005/05/30 04:57:36 shadow Exp $");
  
  #ifdef KERNEL
  #include "afs/sysincludes.h"
--- 17,23 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx.c,v 1.58.2.21 2005/08/28 20:43:36 shadow Exp $");
  
  #ifdef KERNEL
  #include "afs/sysincludes.h"
***************
*** 2602,2607 ****
--- 2602,2625 ----
  	    clock_GetTime(&call->queueTime);
  	    hzero(call->bytesSent);
  	    hzero(call->bytesRcvd);
+ 	    /*
+ 	     * If the number of queued calls exceeds the overload
+ 	     * threshold then abort this call.
+ 	     */
+ 	    if ((rx_BusyThreshold > 0) && (rx_nWaiting > rx_BusyThreshold)) {
+ 		struct rx_packet *tp;
+ 		
+ 		rxi_CallError(call, rx_BusyError);
+ 		tp = rxi_SendCallAbort(call, np, 1, 0);
+ 		MUTEX_EXIT(&call->lock);
+ 		MUTEX_ENTER(&conn->conn_data_lock);
+ 		conn->refCount--;
+ 		MUTEX_EXIT(&conn->conn_data_lock);
+ 		MUTEX_ENTER(&rx_stats_mutex);
+ 		rx_stats.nBusies++;
+ 		MUTEX_EXIT(&rx_stats_mutex);
+ 		return tp;
+ 	    }
  	    rxi_KeepAliveOn(call);
  	} else if (np->header.callNumber != currentCallNumber) {
  	    /* Wait until the transmit queue is idle before deciding
