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.
This commit is contained in:
Jeffrey Altman 2004-04-06 23:31:03 +00:00 committed by Jeffrey Altman
parent afb8a66540
commit 99c6354d4f

View File

@ -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);