]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Linux: drop GLOCK before calling dput
authorMarc Dionne <marc.c.dionne@gmail.com>
Thu, 6 Sep 2012 00:25:55 +0000 (20:25 -0400)
committerPaul Smeddle <paul.smeddle@gmail.com>
Wed, 5 Dec 2012 17:30:40 +0000 (09:30 -0800)
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.

Reviewed-on: http://gerrit.openafs.org/8046
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 0dac4de8eee84a43ef06c56dfc867c2a1b9a9f0c)

Change-Id: Ide1dfc73ebc5fa207c19be1c16db9910cf66bea3
Reviewed-on: http://gerrit.openafs.org/8561
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
src/afs/afs_pioctl.c

index d96a842753d3869b6af0d4356e8f5f46000765e5..3c01be5f06ec2599fcbbb1c6ac7b98fafdc3020c 100644 (file)
@@ -1218,7 +1218,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))