[PATCH] Fix for "cgroup: Assign subsystem IDs during compile time"

STALE5073d

5 messages, 2 authors, 2012-09-14 · open the first message on its own page

[PATCH] Fix for "cgroup: Assign subsystem IDs during compile time"

From: Daniel Wagner <hidden>
Date: 2012-09-14 14:33:16

From: Daniel Wagner <redacted>

Hi, 

Sorry for breaking Tejun's cgroup for-3.7 branch. Here are two patches
which fix this problem. Either of them will do. 

cheers,
daniel

Cc: "David S. Miller" <davem@davemloft.net>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Gao feng <redacted>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Joe Perches <joe@perches.com>
Cc: John Fastabend <redacted>
Cc: Li Zefan <redacted>
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: Rick Jones <redacted>
Cc: Stanislav Kinsbursky <redacted>
Cc: Tejun Heo <tj@kernel.org>
Cc: netdev@vger.kernel.org
Cc: cgroups@vger.kernel.org

-- 
1.7.12.315.g682ce8b

[PATCH v6] cgroup: net_cls: Move sock_update_classid() declaration to cls_cgroup.h

From: Daniel Wagner <hidden>
Date: 2012-09-14 14:33:19

From: Daniel Wagner <redacted>

The two users of sock_update_classid() are net/socket.c and
drivers/net/tun.c. socket.c includes cls_cgroup.h already. Update
tun.c to inlcude the header.

Signed-off-by: Daniel Wagner <redacted>
Acked-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <redacted>
Cc: Gao feng <redacted>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: John Fastabend <redacted>
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: Stephen Rothwell <redacted>
Cc: netdev@vger.kernel.org
Cc: cgroups@vger.kernel.org
---

This patch is an updated version of the faulty one. 

 drivers/net/tun.c        | 1 +
 include/net/cls_cgroup.h | 6 ++++++
 include/net/sock.h       | 8 --------
 3 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 3a16d4f..9336b82 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -68,6 +68,7 @@
 #include <net/netns/generic.h>
 #include <net/rtnetlink.h>
 #include <net/sock.h>
+#include <net/cls_cgroup.h>
 
 #include <asm/uaccess.h>
 
diff --git a/include/net/cls_cgroup.h b/include/net/cls_cgroup.h
index a4dc5b0..e88527a 100644
--- a/include/net/cls_cgroup.h
+++ b/include/net/cls_cgroup.h
@@ -24,6 +24,8 @@ struct cgroup_cls_state
 	u32 classid;
 };
 
+extern void sock_update_classid(struct sock *sk);
+
 #ifdef CONFIG_NET_CLS_CGROUP
 static inline u32 task_cls_classid(struct task_struct *p)
 {
@@ -62,6 +64,10 @@ static inline u32 task_cls_classid(struct task_struct *p)
 }
 #endif
 #else
+static inline void sock_update_classid(struct sock *sk)
+{
+}
+
 static inline u32 task_cls_classid(struct task_struct *p)
 {
 	return 0;
diff --git a/include/net/sock.h b/include/net/sock.h
index 72132ae..160a680 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1486,14 +1486,6 @@ extern void *sock_kmalloc(struct sock *sk, int size,
 extern void sock_kfree_s(struct sock *sk, void *mem, int size);
 extern void sk_send_sigurg(struct sock *sk);
 
-#ifdef CONFIG_CGROUPS
-extern void sock_update_classid(struct sock *sk);
-#else
-static inline void sock_update_classid(struct sock *sk)
-{
-}
-#endif
-
 /*
  * Functions to fill in entries in struct proto_ops when a protocol
  * does not implement a particular function.
-- 
1.7.12.315.g682ce8b

[PATCH] cgroup: net_cls: Include missing header with sock_update_classid() definition

From: Daniel Wagner <hidden>
Date: 2012-09-14 14:34:15

From: Daniel Wagner <redacted>

commit 1f66c0a8833c3974ab6b35edcf4f8585b2f94592
Author: Daniel Wagner [off-list ref]
Date:   Wed Sep 12 16:12:01 2012 +0200

    cgroup: net_cls: Move sock_update_classid() declaration to cls_cgroup.h

Claimed that there was only net/socket.c depending on
sock_update_class(). That is not true drivers/net/tun.c needs to
include the cls_cgroup.h header too.

Signed-off-by: Daniel Wagner <redacted>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Gao feng <redacted>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Joe Perches <joe@perches.com>
Cc: John Fastabend <redacted>
Cc: Li Zefan <redacted>
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: Rick Jones <redacted>
Cc: Stanislav Kinsbursky <redacted>
Cc: Tejun Heo <tj@kernel.org>
Cc: netdev@vger.kernel.org
Cc: cgroups@vger.kernel.org
---

This version is on top of the latest cgroup for-3.7 branch.

 drivers/net/tun.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 3a16d4f..9336b82 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -68,6 +68,7 @@
 #include <net/netns/generic.h>
 #include <net/rtnetlink.h>
 #include <net/sock.h>
+#include <net/cls_cgroup.h>
 
 #include <asm/uaccess.h>
 
-- 
1.7.12.315.g682ce8b

Re: [PATCH] cgroup: net_cls: Include missing header with sock_update_classid() definition

From: Sedat Dilek <hidden>
Date: 2012-09-14 14:43:46

On Fri, Sep 14, 2012 at 4:33 PM, Daniel Wagner [off-list ref] wrote:
From: Daniel Wagner <redacted>

commit 1f66c0a8833c3974ab6b35edcf4f8585b2f94592
Author: Daniel Wagner [off-list ref]
Date:   Wed Sep 12 16:12:01 2012 +0200

    cgroup: net_cls: Move sock_update_classid() declaration to cls_cgroup.h

Claimed that there was only net/socket.c depending on
sock_update_class(). That is not true drivers/net/tun.c needs to
include the cls_cgroup.h header too.

Signed-off-by: Daniel Wagner <redacted>
Cc: "David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Cc: "Michael S. Tsirkin" <redacted>
Cc: Gao feng <redacted>
Cc: Jamal Hadi Salim <jhs-jkUAjuhPggJWk0Htik3J/w@public.gmane.org>
Cc: Joe Perches <redacted>
Cc: John Fastabend <redacted>
Cc: Li Zefan <redacted>
Cc: Neil Horman <redacted>
Cc: Rick Jones <redacted>
Cc: Stanislav Kinsbursky <redacted>
Cc: Tejun Heo <redacted>
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
---

This version is on top of the latest cgroup for-3.7 branch.
Thanks for the quick fix.
Please honour Reported-by: Stephen Rothwell [off-list ref].
If this is the fix for the breakage in today's Linux-Next
(next-20120914), please add a "-next" to the subject next time.

- Sedat -
quoted hunk
 drivers/net/tun.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 3a16d4f..9336b82 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -68,6 +68,7 @@
 #include <net/netns/generic.h>
 #include <net/rtnetlink.h>
 #include <net/sock.h>
+#include <net/cls_cgroup.h>

 #include <asm/uaccess.h>

--
1.7.12.315.g682ce8b

--
To unsubscribe from this list: send the line "unsubscribe linux-next" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Re: [PATCH] cgroup: net_cls: Include missing header with sock_update_classid() definition

From: Daniel Wagner <hidden>
Date: 2012-09-14 14:50:22

Hi Sedat,

On 14.09.2012 16:43, Sedat Dilek wrote:
On Fri, Sep 14, 2012 at 4:33 PM, Daniel Wagner [off-list ref] wrote:
quoted
From: Daniel Wagner <redacted>

commit 1f66c0a8833c3974ab6b35edcf4f8585b2f94592
Author: Daniel Wagner [off-list ref]
Date:   Wed Sep 12 16:12:01 2012 +0200

     cgroup: net_cls: Move sock_update_classid() declaration to cls_cgroup.h

Claimed that there was only net/socket.c depending on
sock_update_class(). That is not true drivers/net/tun.c needs to
include the cls_cgroup.h header too.

Signed-off-by: Daniel Wagner <redacted>
Cc: "David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Cc: "Michael S. Tsirkin" <redacted>
Cc: Gao feng <redacted>
Cc: Jamal Hadi Salim <jhs-jkUAjuhPggJWk0Htik3J/w@public.gmane.org>
Cc: Joe Perches <redacted>
Cc: John Fastabend <redacted>
Cc: Li Zefan <redacted>
Cc: Neil Horman <redacted>
Cc: Rick Jones <redacted>
Cc: Stanislav Kinsbursky <redacted>
Cc: Tejun Heo <redacted>
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
---

This version is on top of the latest cgroup for-3.7 branch.
Thanks for the quick fix.
No problem. I am still ashamed not finding it myself.
Please honour Reported-by: Stephen Rothwell [off-list ref].
Sure, will do next time.
If this is the fix for the breakage in today's Linux-Next
(next-20120914), please add a "-next" to the subject next time.
Correct, this one is for linux-next but I got the impression that cgroup 
for-3.7 branch was ignored because of this. Therefore I have send two 
versions. Hmm, I'll need to check the results of todays next tree.

thanks,
daniel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help