]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-linux-rx-kernel-listener-kill-task-directly-20080130
authorSimon Wilkinson <sxw@inf.ed.ac.uk>
Wed, 30 Jan 2008 17:26:22 +0000 (17:26 +0000)
committerDerrick Brashear <shadow@dementia.org>
Wed, 30 Jan 2008 17:26:22 +0000 (17:26 +0000)
LICENSE IPL10

based on work from shadow@dementia.org

since the tasklist lock and rcu stuff can/will be de-exported, and we don't
need it anyway...

(cherry picked from commit c5afa335a8ffb86cf17c32173eb0e1c26500dd80)

src/afs/LINUX/osi_misc.c
src/rx/LINUX/rx_knet.c
src/rx/rx_kcommon.c

index 09b3f22855dd69f44cc4b9462b089486dd25d509..7bc45c61d7095099d770552566f083b0ba967f1b 100644 (file)
@@ -348,8 +348,6 @@ osi_linux_free_inode_pages(void)
     }
 }
 
-struct task_struct *rxk_ListenerTask;
-
 void
 osi_linux_mask(void)
 {
@@ -358,9 +356,3 @@ osi_linux_mask(void)
     RECALC_SIGPENDING(current);
     SIG_UNLOCK(current);
 }
-
-void
-osi_linux_rxkreg(void)
-{
-    rxk_ListenerTask = current;
-}
index 9d3b4ada2e5676fb61487ce8dd76463215151937..ab1ec2b075ba40ab3da4a91e21c1d3035aff6196 100644 (file)
@@ -216,36 +216,16 @@ osi_StopListener(void)
 {
     struct task_struct *listener;
     extern int rxk_ListenerPid;
+    extern struct task_struct *rxk_ListenerTask;
 
-    while (rxk_ListenerPid) {
-#ifdef EXPORTED_TASKLIST_LOCK
-       if (&tasklist_lock)
-          read_lock(&tasklist_lock);
-#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
-#ifdef EXPORTED_TASKLIST_LOCK
-       else
-#endif
-          rcu_read_lock();
-#endif
-       listener = find_task_by_pid(rxk_ListenerPid);
-        if (listener) {
-           flush_signals(listener);
-           force_sig(SIGKILL, listener);
+    while (rxk_ListenerTask) {
+        if (rxk_ListenerTask) {
+           flush_signals(rxk_ListenerTask);
+           force_sig(SIGKILL, rxk_ListenerTask);
        }
-#ifdef EXPORTED_TASKLIST_LOCK
-       if (&tasklist_lock)
-           read_unlock(&tasklist_lock);
-#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
-#ifdef EXPORTED_TASKLIST_LOCK
-       else
-#endif
-          rcu_read_unlock();
-#endif
-       if (!listener)
+       if (!rxk_ListenerTask)
            break;
-       afs_osi_Sleep(&rxk_ListenerPid);
+       afs_osi_Sleep(&rxk_ListenerTask);
     }
     sock_release(rx_socket);
     rx_socket = NULL;
index f7572d7da1d16b96cb1d8af9a58fc3a484d638e9..4c056ff96ad5fa4609cc70565413a2f5a3f3155c 100644 (file)
@@ -1206,6 +1206,9 @@ rxk_ReadPacket(osi_socket so, struct rx_packet *p, int *host, int *port)
  * OS's socket receive routine returns as a result of a signal.
  */
 int rxk_ListenerPid;           /* Used to signal process to wakeup at shutdown */
+#ifdef AFS_LINUX20_ENV
+struct task_struct *rxk_ListenerTask;
+#endif
 
 #ifdef AFS_SUN5_ENV
 /*
@@ -1235,6 +1238,7 @@ rxk_Listener(void)
 
 #ifdef AFS_LINUX20_ENV
     rxk_ListenerPid = current->pid;
+    rxk_ListenerTask = current;
 #endif
 #ifdef AFS_SUN5_ENV
     rxk_ListenerPid = 1;       /* No PID, just a flag that we're alive */
@@ -1271,7 +1275,11 @@ rxk_Listener(void)
        osi_rxWakeup(&afs_termState);
     }
     rxk_ListenerPid = 0;
-#if defined(AFS_LINUX22_ENV) || defined(AFS_SUN5_ENV)
+#ifdef AFS_LINUX20_ENV
+    rxk_ListenerTask = 0;
+    osi_rxWakeup(&rxk_ListenerTask);
+#endif
+#if defined(AFS_SUN5_ENV)
     osi_rxWakeup(&rxk_ListenerPid);
 #endif
 #ifdef AFS_SUN5_ENV