pagg
[Top] [All Lists]

Re: [patch] Minor PAGG attach/detach semantic change for 2.6.11

To: Kingsley Cheung <kingsley@xxxxxxxxxx>
Subject: Re: [patch] Minor PAGG attach/detach semantic change for 2.6.11
From: Erik Jacobson <erikj@xxxxxxx>
Date: Tue, 4 Oct 2005 09:26:39 -0500
Cc: Erik Jacobson <erikj@xxxxxxx>, pagg@xxxxxxxxxxx, tonyt@xxxxxxxxxx
In-reply-to: <20051004065215.GB4533@xxxxxxxxxx>
References: <20050617014512.GA10285@xxxxxxxxxx> <20050927201020.GA30433@xxxxxxx> <20050929051627.GC3404@xxxxxxxxxx> <20050929151205.GB7395@xxxxxxx> <20050929223827.GA2737@xxxxxxxxxx> <20050930205858.GA10565@xxxxxxx> <20051004063558.GA4533@xxxxxxxxxx> <20051004065215.GB4533@xxxxxxxxxx>
Sender: pagg-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.6i
Ok; so I think this matches what you were suggested.  We unsubscribe the
subscriber that knows about the failure.  For other subscribers, they now
get cleaned up in copy_process when the fork fails.

The changes to __pnotify_fork are just comment changes.

I'll run some tests against this but my tests won't catch this type of
thing, at least not yet.


diff -Narup -x linux/.pc linux-orig/kernel/fork.c linux/kernel/fork.c
--- linux-orig/kernel/fork.c    2005-10-04 09:01:09.105780000 -0500
+++ linux/kernel/fork.c 2005-10-04 09:19:14.548775980 -0500
@@ -1086,7 +1086,7 @@ static task_t *copy_process(unsigned lon
        if (sigismember(&current->pending.signal, SIGKILL)) {
                write_unlock_irq(&tasklist_lock);
                retval = -EINTR;
-               goto bad_fork_cleanup_pnotify;
+               goto bad_fork_cleanup_namespace;
        }
 
        /* CLONE_PARENT re-uses the old parent */
@@ -1172,9 +1172,8 @@ fork_out:
                return ERR_PTR(retval);
        return p;
 
-bad_fork_cleanup_pnotify:
-       pnotify_exit(p);
 bad_fork_cleanup_namespace:
+       pnotify_exit(p);
        exit_namespace(p);
 bad_fork_cleanup_keys:
        exit_keys(p);
diff -Narup -x linux/.pc linux-orig/kernel/pnotify.c linux/kernel/pnotify.c
--- linux-orig/kernel/pnotify.c 2005-09-30 16:05:56.548237000 -0500
+++ linux/kernel/pnotify.c      2005-10-04 09:22:02.585499338 -0500
@@ -458,10 +458,10 @@ __pnotify_fork(struct task_struct *to_ta
                                                  from_subscriber->events);
                if (!to_subscriber) {
                        /* Failed to get memory.
-                        * we don't force __pnotify_exit to run here because
-                        * the child is in-consturction and not running yet.
                         * We don't need a write lock on the subscriber
                         * list because the child is in construction.
+                        * pnotify_exit is run in copy_process for failed
+                        * forks and will clean up the other subscribers.
                         */
                        pnotify_unsubscribe(to_task);
                        up_read(&from_task->pnotify_subscriber_list_sem);
@@ -474,8 +474,8 @@ __pnotify_fork(struct task_struct *to_ta
                        /* Propagates to copy_process as a fork failure.
                         * Since the child is in consturction, we don't
                         * need a write lock on the subscriber list.
-                        * __pnotify_exit isn't run because the child
-                        * never got running, exit doesn't make sense.
+                        * pnotify_exit is run in copy_process for failed
+                        * forks and will clean up the other subscribers.
                         */
                        pnotify_unsubscribe(to_task);
                        up_read(&from_task->pnotify_subscriber_list_sem);


<Prev in Thread] Current Thread [Next in Thread>