linux-hold-glock-across-dentry-trace-entries-while-tracing-20020725
authorChas Williams <chas@cmf.nrl.navy.mil>
Fri, 26 Jul 2002 00:11:30 +0000 (00:11 +0000)
committerDerrick Brashear <shadow@dementia.org>
Fri, 26 Jul 2002 00:11:30 +0000 (00:11 +0000)
this is actually rather scary

src/afs/LINUX/osi_vnodeops.c

index e18d6b3..73e22c1 100644 (file)
@@ -931,19 +931,27 @@ static int afs_linux_dentry_revalidate(struct dentry *dp)
 /* afs_dentry_iput */
 static void afs_dentry_iput(struct dentry *dp, struct inode *ip)
 {
-    afs_Trace3(afs_iclSetp, CM_TRACE_DENTRYIPUT,
-              ICL_TYPE_POINTER, ip,
-              ICL_TYPE_STRING, dp->d_parent->d_name.name,
-              ICL_TYPE_STRING, dp->d_name.name);
+    if (ICL_SETACTIVE(afs_iclSetp)) {
+       AFS_GLOCK();
+       afs_Trace3(afs_iclSetp, CM_TRACE_DENTRYIPUT,
+                  ICL_TYPE_POINTER, ip,
+                  ICL_TYPE_STRING, dp->d_parent->d_name.name,
+                  ICL_TYPE_STRING, dp->d_name.name);
+       AFS_GUNLOCK();
+    }
 
     osi_iput(ip);
 }
 
 static int afs_dentry_delete(struct dentry *dp)
 {
-    afs_Trace3(afs_iclSetp, CM_TRACE_DENTRYDELETE, ICL_TYPE_POINTER, 
-              dp->d_inode, ICL_TYPE_STRING, dp->d_parent->d_name.name,
-              ICL_TYPE_STRING, dp->d_name.name);
+    if (ICL_SETACTIVE(afs_iclSetp)) {
+       AFS_GLOCK();
+       afs_Trace3(afs_iclSetp, CM_TRACE_DENTRYDELETE, ICL_TYPE_POINTER, 
+                  dp->d_inode, ICL_TYPE_STRING, dp->d_parent->d_name.name,
+                  ICL_TYPE_STRING, dp->d_name.name);
+       AFS_GUNLOCK();
+    }
 
     if (dp->d_inode && (ITOAFS(dp->d_inode)->states & CUnlinked))
        return 1;               /* bad inode? */