From: Jeffrey Altman Date: Tue, 6 Apr 2004 23:31:03 +0000 (+0000) Subject: more-mutex-20040406 X-Git-Tag: openafs-devel-1_3_64~73 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=99c6354d4f92eadf5d57f4001d0fadc37ef4f40c;p=packages%2Fo%2Fopenafs.git more-mutex-20040406 Rodney found in his logs "Event Object Already Exists fid_t" messages. This lead to another location in the code where problem mutex usage was missing. In this case, multiple fid_t structs were created with the same fid number. --- diff --git a/src/WINNT/afsd/smb.c b/src/WINNT/afsd/smb.c index 64de697a0..c49bb7de3 100644 --- a/src/WINNT/afsd/smb.c +++ b/src/WINNT/afsd/smb.c @@ -973,6 +973,7 @@ smb_fid_t *smb_FindFID(smb_vc_t *vcp, unsigned short fid, int flags) smb_fid_t *fidp; int newFid; + lock_ObtainWrite(&smb_rctLock); /* figure out if we need to allocate a new file ID */ if (fid == 0) { newFid = 1; @@ -980,7 +981,6 @@ smb_fid_t *smb_FindFID(smb_vc_t *vcp, unsigned short fid, int flags) } else newFid = 0; - lock_ObtainWrite(&smb_rctLock); retry: for(fidp = vcp->fidsp; fidp; fidp = (smb_fid_t *) osi_QNext(&fidp->q)) { if (fid == fidp->fid) { @@ -1010,7 +1010,8 @@ retry: afsi_log("Event Object Already Exists: %s", eventName); if (newFid) { vcp->fidCounter = fid+1; - if (vcp->fidCounter == 0) vcp->fidCounter = 1; + if (vcp->fidCounter == 0) + vcp->fidCounter = 1; } } lock_ReleaseWrite(&smb_rctLock);