]> git.tue.mpg.de Git - paraslash.git/commitdiff
Fix afs shutdown.
authorAndre Noll <maan@systemlinux.org>
Mon, 31 Mar 2008 17:08:34 +0000 (19:08 +0200)
committerAndre Noll <maan@systemlinux.org>
Mon, 31 Mar 2008 17:08:34 +0000 (19:08 +0200)
In case para_server dies, the afs process must unregister all
tasks in order to shut down cleanly.

afs.c

diff --git a/afs.c b/afs.c
index 0454b8ef8d46f78c8348c74111efcdb31f54f722..03a8d4b97a6c02a0544ff68dba4400dc93dfeb92 100644 (file)
--- a/afs.c
+++ b/afs.c
@@ -763,8 +763,8 @@ static void signal_post_select(struct sched *s, struct task *t)
 {
        struct signal_task *st = container_of(t, struct signal_task, task);
        if (getppid() == 1) {
-               t->error = -E_AFS_PARENT_DIED;
-               return;
+               PARA_EMERG_LOG("para_server died\n");
+               goto shutdown;
        }
        if (!FD_ISSET(st->fd, &s->rfds))
                return;
@@ -777,6 +777,8 @@ static void signal_post_select(struct sched *s, struct task *t)
                init_admissible_files(current_mop);
                return;
        }
+       PARA_EMERG_LOG("terminating on signal %d\n", st->signum);
+shutdown:
        sched_shutdown();
        t->error = -E_AFS_SIGNAL;
 }