From: Marc Dionne Date: Thu, 6 Sep 2012 00:25:55 +0000 (-0400) Subject: Linux: drop GLOCK before calling dput X-Git-Tag: openafs-stable-1_8_0pre1~2040 X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=0dac4de8eee84a43ef06c56dfc867c2a1b9a9f0c;hp=777e03103f5eb05012ea1f7f23624515e4ed6bb4 Linux: drop GLOCK before calling dput Holding the GLOCK when calling dput can result in a deadlock when the kernel calls back into afs_dentry_iput. It should be safe to drop the lock here. Change-Id: I8966aea7336b39b4c3ec265a53d820fc6135eeaf Reviewed-on: http://gerrit.openafs.org/8046 Reviewed-by: Simon Wilkinson Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- diff --git a/src/afs/afs_pioctl.c b/src/afs/afs_pioctl.c index aab52ff..0836b87 100644 --- a/src/afs/afs_pioctl.c +++ b/src/afs/afs_pioctl.c @@ -1239,7 +1239,13 @@ afs_syscall_pioctl(char *path, unsigned int com, caddr_t cmarg, int follow) #endif /* AFS_NEED_CLIENTCONTEXT */ if (vp) { #ifdef AFS_LINUX22_ENV + /* + * Holding the global lock when calling dput can cause a deadlock + * when the kernel calls back into afs_dentry_iput + */ + AFS_GUNLOCK(); dput(dp); + AFS_GLOCK(); #else #if defined(AFS_FBSD80_ENV) if (VOP_ISLOCKED(vp))