From 99c6354d4f92eadf5d57f4001d0fadc37ef4f40c Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Tue, 6 Apr 2004 23:31:03 +0000 Subject: [PATCH] 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. --- src/WINNT/afsd/smb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); -- 2.39.5