linux-dentry-revalidate-lock-kernel-20020813
authorChas Williams <chas@cmf.nrl.navy.mil>
Mon, 19 Aug 2002 22:52:52 +0000 (22:52 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 19 Aug 2002 22:52:52 +0000 (22:52 +0000)
avoid potential race for shrink_dcache_parent/d_drop

smbfs and nfs do equivalent.

====================
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.
====================

avoid potential race for shrink_dcache_parent/d_drop

smbfs and nfs do equivalent.

slight rework to avoid holding glock in a way which could deadlock us

src/afs/LINUX/osi_vnodeops.c

index 8e2264c..14bf5fb 100644 (file)
@@ -840,6 +840,7 @@ static int afs_linux_dentry_revalidate(struct dentry *dp)
     struct vcache *parentvcp = ITOAFS(dp->d_parent->d_inode);
 
     AFS_GLOCK();
+    lock_kernel();
 
     sysState.allocked = 0;
 
@@ -896,6 +897,7 @@ done:
         shrink_dcache_parent(dp);
         d_drop(dp);
     }
+    unlock_kernel();
 
     return !bad_dentry;
 }