From 259bf2a7d42f045420a422fd112e3bafd38b7f91 Mon Sep 17 00:00:00 2001 From: Nickolai Zeldovich Date: Thu, 10 Jan 2002 06:42:21 +0000 Subject: [PATCH] solaris-obtain-locks-under-GLOCK-20020101 Fix the two places in Solaris afs_GetOnePage where locks are obtained/released without GLOCK. ==================== This delta was composed from multiple commits as part of the CVS->Git migration. The checkin message with each commit was inconsistent. The following are the additional commit messages. ==================== Fix the two places in Solaris afs_GetOnePage where locks are obtained/released without GLOCK. (Fix error in application of patch) --- src/afs/SOLARIS/osi_vnodeops.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/afs/SOLARIS/osi_vnodeops.c b/src/afs/SOLARIS/osi_vnodeops.c index 13c2ea37cd..d399590849 100644 --- a/src/afs/SOLARIS/osi_vnodeops.c +++ b/src/afs/SOLARIS/osi_vnodeops.c @@ -496,22 +496,20 @@ retry: buf->b_blkno = btodb(toffset); bp_mapin(buf); /* map it in to our address space */ - /* afs_ustrategy will want to lock the dcache entry */ - ReleaseReadLock(&tdc->lock); -#ifndef AFS_SUN5_ENV - ReleaseReadLock(&avc->lock); -#endif #if defined(AFS_SUN5_ENV) AFS_GLOCK(); + /* afs_ustrategy will want to lock the dcache entry */ + ReleaseReadLock(&tdc->lock); code = afs_ustrategy(buf, acred); /* do the I/O */ + ObtainReadLock(&tdc->lock); AFS_GUNLOCK(); #else + ReleaseReadLock(&tdc->lock); + ReleaseReadLock(&avc->lock); code = afs_ustrategy(buf); /* do the I/O */ -#endif -#ifndef AFS_SUN5_ENV ObtainReadLock(&avc->lock); -#endif ObtainReadLock(&tdc->lock); +#endif #ifdef AFS_SUN5_ENV /* Before freeing unmap the buffer */