]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-linux-lock-tracking-20070208
authorJeffrey Hutzelman <jhutz@cmu.edu>
Thu, 8 Feb 2007 22:39:29 +0000 (22:39 +0000)
committerDerrick Brashear <shadow@dementia.org>
Thu, 8 Feb 2007 22:39:29 +0000 (22:39 +0000)
FIXES 31818

avoid a potential leaked lock when closing firefox.

(cherry picked from commit b0425c4e7f65c00fe217d7c54d309bceac9b38d5)

acinclude.m4
src/afs/LINUX/osi_machdep.h
src/afs/afs_osi.h
src/cf/linux-test4.m4

index d014a46c0a74493e70958d2419b9645d17d1f154..857c49cc5a682be86562a6b3055c1500092db410 100644 (file)
@@ -637,6 +637,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_RLIM
                 LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGNAL_RLIM
                 LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_EXIT_STATE
+                LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_TGID
                 LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_TODO
                 LINUX_GET_SB_HAS_STRUCT_VFSMOUNT
                 LINUX_STATFS_TAKES_DENTRY
@@ -813,6 +814,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 if test "x$ac_cv_linux_sched_struct_task_struct_has_exit_state" = "xyes"; then 
                  AC_DEFINE(STRUCT_TASK_STRUCT_HAS_EXIT_STATE, 1, [define if your struct task_struct has exit_state])
                 fi
+                if test "x$ac_cv_linux_sched_struct_task_struct_has_tgid" = "xyes"; then 
+                 AC_DEFINE(STRUCT_TASK_STRUCT_HAS_TGID, 1, [define if your struct task_struct has tgid])
+                fi
                 if test "x$ac_cv_linux_sched_struct_task_struct_has_todo" = "xyes"; then 
                  AC_DEFINE(STRUCT_TASK_STRUCT_HAS_TODO, 1, [define if your struct task_struct has todo])
                 fi
index 52488af124f98c60f0d49c51b376f7ae3bb4dd65..836a98df11a394e0bf662a4e4e79d504534db7fc 100644 (file)
 
 #undef getuerror
 
+#ifdef STRUCT_TASK_STRUCT_HAS_TGID
+#define getpid() current->tgid
+#ifdef STRUCT_TASK_STRUCT_HAS_REAL_PARENT
+#define getppid() current->real_parent->tgid
+#elif defined(STRUCT_TASK_STRUCT_HAS_PARENT)
+#define getppid() current->parent->tgid
+#else
+#define getppid() current->p_opptr->tgid
+#endif
+#else /* !STRUCT_TASK_STRUCT_HAS_TGID */
 #define getpid() current->pid
 #ifdef STRUCT_TASK_STRUCT_HAS_REAL_PARENT
 #define getppid() current->real_parent->pid
@@ -36,6 +46,7 @@
 #else
 #define getppid() current->p_opptr->pid
 #endif
+#endif /* STRUCT_TASK_STRUCT_HAS_TGID */
 
 #ifdef RECALC_SIGPENDING_TAKES_VOID
 #define RECALC_SIGPENDING(X) recalc_sigpending()
index 9eb0a273fcc396e83891f3825af1e899e9dbd988..c66ece8862180cd70536d89f32df8865b316517c 100644 (file)
@@ -212,8 +212,12 @@ typedef struct timeval osi_timeval_t;
 /* should use curthread, but 'ps' can't display it */
 #define osi_ThreadUnique()     curproc
 #else
+#ifdef AFS_LINUX_ENV
+#define osi_ThreadUnique()     (current->pid)
+#else
 #define osi_ThreadUnique()     getpid()
 #endif
+#endif
 
 
 
index c75a30751b100ec1e55886569ba5565c3cbcb560..356c7e6041437ac30fa5885e905b9d4da8efbc91 100644 (file)
@@ -333,6 +333,18 @@ printk("%d\n", _tsk.parent);],
   AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_parent)])
 
 
+AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_TGID], [
+  AC_MSG_CHECKING([for tgid in struct task_struct])
+  AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_tgid], [
+    AC_TRY_KBUILD(
+[#include <linux/sched.h>],
+[struct task_struct _tsk;
+printk("%d\n", _tsk.tgid);],
+      ac_cv_linux_sched_struct_task_struct_has_tgid=yes,
+      ac_cv_linux_sched_struct_task_struct_has_tgid=no)])
+  AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_tgid)])
+
+
 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_REAL_PARENT], [
   AC_MSG_CHECKING([for real_parent in struct task_struct])
   AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_real_parent], [