From: Derrick Brashear Date: Wed, 21 Jul 2004 23:23:38 +0000 (+0000) Subject: fstrace-avoid-double-glock-in-dentry-code-during-fstrace-20040719 X-Git-Tag: openafs-devel-1_3_66~24 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=efce9b6f2994bb1e0a9f28f059e9733fb0d964fb;p=packages%2Fo%2Fopenafs.git fstrace-avoid-double-glock-in-dentry-code-during-fstrace-20040719 fstracing on a linux machine and trying to fs flush a file in the cache would trigger a hang on a machine with SMP kernel. fix it. ==================== 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. ==================== fstracing on a linux machine and trying to fs flush a file in the cache would tr igger a hang on a machine with SMP kernel. fix it. --- diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index 54f315fa8..ab516a17c 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -933,12 +933,15 @@ afs_linux_dentry_revalidate(struct dentry *dp) static void afs_dentry_iput(struct dentry *dp, struct inode *ip) { + int isglock; + if (ICL_SETACTIVE(afs_iclSetp)) { - AFS_GLOCK(); + isglock = ISAFS_GLOCK(); + if (!isglock) 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(); + if (!isglock) AFS_GUNLOCK(); } osi_iput(ip); @@ -948,12 +951,14 @@ afs_dentry_iput(struct dentry *dp, struct inode *ip) static int afs_dentry_delete(struct dentry *dp) { + int isglock; if (ICL_SETACTIVE(afs_iclSetp)) { - AFS_GLOCK(); + isglock = ISAFS_GLOCK(); + if (!isglock) 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 (!isglock) AFS_GUNLOCK(); } if (dp->d_inode && (ITOAFS(dp->d_inode)->states & CUnlinked))