From: Chas Williams Date: Thu, 16 Aug 2001 02:01:05 +0000 (+0000) Subject: linux-osi-clear-inode-locking-fix-20010816 X-Git-Tag: BP-openafs-stable-1_2_x~57 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=e8591334602e5e8dad78dc6426d3c44d564572c1;p=packages%2Fo%2Fopenafs.git linux-osi-clear-inode-locking-fix-20010816 "i think this was missed from a patch i sent a while back to cleanup the iput() of afs inodes. i think the lock(vc->lock) needs to be in osi_clear_inode() since osi_clear_inode is called a bit more often than afs_delete_inode(). however, this like just might be uneeded since no one has seen any problems apparently." --- diff --git a/src/afs/LINUX/osi_misc.c b/src/afs/LINUX/osi_misc.c index d4faa31e0..2c3dc60fd 100644 --- a/src/afs/LINUX/osi_misc.c +++ b/src/afs/LINUX/osi_misc.c @@ -338,7 +338,9 @@ void osi_clear_inode(struct inode *ip) #endif printf("afs_put_inode: ino %d (0x%x) has count %d\n", ip->i_ino, ip); + ObtainWriteLock(&vc->lock, 504); afs_InactiveVCache(vc, credp); + ReleaseWriteLock(&vc->lock); #if defined(AFS_LINUX24_ENV) atomic_set(&ip->i_count, 0); #else @@ -378,12 +380,10 @@ void osi_iput(struct inode *ip) if (!ip->i_count) #endif osi_clear_inode(ip); - AFS_GUNLOCK(); } - else { - AFS_GUNLOCK(); + else iput(ip); - } + AFS_GUNLOCK(); } /* check_bad_parent() : Checks if this dentry's vcache is a root vcache diff --git a/src/afs/LINUX/osi_vfsops.c b/src/afs/LINUX/osi_vfsops.c index babf32993..4743782ec 100644 --- a/src/afs/LINUX/osi_vfsops.c +++ b/src/afs/LINUX/osi_vfsops.c @@ -244,9 +244,7 @@ void afs_delete_inode(struct inode *ip) struct vcache *vc = (struct vcache*)ip; AFS_GLOCK(); - ObtainWriteLock(&vc->lock, 504); osi_clear_inode(ip); - ReleaseWriteLock(&vc->lock); AFS_GUNLOCK(); }