From ba17b213b827b702880c170e097f29ce5a8d6b2a Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Wed, 22 Feb 2006 14:29:22 +0000 Subject: [PATCH] STABLE14-windows-brl-fix-20060222 make sure that we obtain a LockWrite if AGRESSIVE_LOCKS is defined --- src/WINNT/afsd/cm_vnodeops.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/WINNT/afsd/cm_vnodeops.c b/src/WINNT/afsd/cm_vnodeops.c index 71c113de4..83a3c7024 100644 --- a/src/WINNT/afsd/cm_vnodeops.c +++ b/src/WINNT/afsd/cm_vnodeops.c @@ -3387,7 +3387,12 @@ long cm_Lock(cm_scache_t *scp, unsigned char sLockType, cm_fid_t cfid; int newLock; - if (scp->serverLock == LockRead && Which == LockWrite) { +#ifndef AGGRESSIVE_LOCKS + newLock = Which; +#else + newLock = LockWrite; +#endif + if (scp->serverLock == LockRead && newLock == LockWrite) { /* We want to escalate the lock to a LockWrite. Unfortunately that's not really possible without @@ -3433,18 +3438,13 @@ long cm_Lock(cm_scache_t *scp, unsigned char sLockType, } } - /* We need to obtain a server lock of type Which in order + /* We need to obtain a server lock of type newLock in order to assert this file lock */ tfid.Volume = scp->fid.volume; tfid.Vnode = scp->fid.vnode; tfid.Unique = scp->fid.unique; cfid = scp->fid; -#ifndef AGGRESSIVE_LOCKS - newLock = Which; -#else - newLock = LockWrite; -#endif osi_Log3(afsd_logp, "CALL SetLock scp 0x%x from %d to %d", (long) scp, (int) scp->serverLock, newLock); lock_ReleaseMutex(&scp->mx); -- 2.39.5