if (aclScp != scp) {
if (aclScp->fid.vnode < scp->fid.vnode)
lock_ReleaseWrite(&scp->rw);
- lock_ObtainRead(&aclScp->rw);
+ lock_ObtainWrite(&aclScp->rw);
didLock = 1;
if (aclScp->fid.vnode < scp->fid.vnode)
lock_ObtainWrite(&scp->rw);
}
}
- lock_AssertAny(&aclScp->rw);
+ lock_AssertWrite(&aclScp->rw);
/* now if rights is a subset of the public rights, we're done.
* Otherwise, if we an explicit acl entry, we're also in good shape,
if (volp)
cm_PutVolume(volp);
if (didLock)
- lock_ReleaseRead(&aclScp->rw);
+ lock_ReleaseWrite(&aclScp->rw);
if (release)
cm_ReleaseSCache(aclScp);
return code;
/*
* Get an acl cache entry for a particular user and file, or return that it doesn't exist.
- * Called with the scp locked.
+ * Called with the scp write locked.
*/
long cm_FindACLCache(cm_scache_t *scp, cm_user_t *userp, afs_uint32 *rightsp)
{
long retval = -1;
time_t now = time(NULL);
+ lock_AssertWrite(&scp->rw);
lock_ObtainWrite(&cm_aclLock);
*rightsp = 0; /* get a new acl from server if we don't find a
* current entry