[Lxc-users] lxc-attach & setns patch for kernel 2.6.34

Sebastien Pahl seb at dotcloud.com
Wed Jul 28 08:41:10 UTC 2010


Hi,

I'm trying to adapt the patch for lxc-attach to 2.6.34.
A few hunks fail but they are trivial to fix.
There is only one where I'm not sure:

<------------------------------>

Index: 2.6.33/kernel/cgroup.c
===================================================================
--- 2.6.33.orig/kernel/cgroup.c
+++ 2.6.33/kernel/cgroup.c
@@ -2453,7 +2453,7 @@ static struct cgroup_pidlist *cgroup_pid
{
  struct cgroup_pidlist *l;
  /* don't need task_nsproxy() if we're looking at ourself */
-   struct pid_namespace *ns = get_pid_ns(current->nsproxy->pid_ns);
+   struct pid_namespace *ns =
get_pid_ns(task_active_pid_ns(current));
  /*
   * We can't drop the pidlist_mutex before taking the l->mutex in
case
   * the last ref-holder is trying to remove l from the list at the
same

<------------------------------>

The kernel/cgroup.c file has changed:

Instead of:

struct pid_namespace *ns = get_pid_ns(current->nsproxy->pid_ns);

now there is:

struct pid_namespace *ns = current->nsproxy->pid_ns;

>From what I have seen in the rest of the code I assume I can just
replace it by this line:

struct pid_namespace *ns = task_active_pid_ns(current);

Am I correct in my assumptions?

-- 
Sebastien Pahl
@sebp




More information about the lxc-users mailing list