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 0454b8e..03a8d4b 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) {
 {
        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;
        }
        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;
        }
                init_admissible_files(current_mop);
                return;
        }
+       PARA_EMERG_LOG("terminating on signal %d\n", st->signum);
+shutdown:
        sched_shutdown();
        t->error = -E_AFS_SIGNAL;
 }
        sched_shutdown();
        t->error = -E_AFS_SIGNAL;
 }