linux-next: build failure after merge of the final tree (net-nexttree related)

From: Stephen Rothwell
Date: Wed Dec 14 2011 - 02:08:05 EST


Hi ,

After merging the final tree, today's linux-next build (powerpc
allnoconfig) failed like this:

In file included from include/linux/tcp.h:211:0,
from include/linux/ipv6.h:221,
from include/net/ipv6.h:16,
from include/linux/sunrpc/clnt.h:26,
from include/linux/nfs_fs.h:50,
from init/do_mounts.c:20:
include/net/sock.h: In function 'memcg_memory_allocated_add':
include/net/sock.h:1000:20: error: 'OVER_LIMIT' undeclared (first use in this function)

And several other similar ones.

Caused by commit e1aab161e013 ("socket: initial cgroup code") from the
net-next tree. OVER_LIMIT is only defined it CONFIG_INET is set.

I applied the following (stupid) patch for today (just because reverting
the above commit would probably be too hard - we have cgroup stuff all
over the place :-( ):

From: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
Date: Wed, 14 Dec 2011 18:01:12 +1100
Subject: [PATCH] socket: bad fix for cgroup code breakage

Signed-off-by: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
---
include/net/sock.h | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/net/sock.h b/include/net/sock.h
index 6fe0dae..0603973 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -986,6 +986,7 @@ static inline long sk_prot_mem_limits(const struct sock *sk, int index)
return prot[index];
}

+#ifdef CONFIG_INET
static inline void memcg_memory_allocated_add(struct cg_proto *prot,
unsigned long amt,
int *parent_status)
@@ -999,6 +1000,7 @@ static inline void memcg_memory_allocated_add(struct cg_proto *prot,
if (ret < 0)
*parent_status = OVER_LIMIT;
}
+#endif

static inline void memcg_memory_allocated_sub(struct cg_proto *prot,
unsigned long amt)
@@ -1028,12 +1030,14 @@ sk_memory_allocated_add(struct sock *sk, int amt, int *parent_status)
{
struct proto *prot = sk->sk_prot;

+#ifdef CONFIG_INET
if (mem_cgroup_sockets_enabled && sk->sk_cgrp) {
memcg_memory_allocated_add(sk->sk_cgrp, amt, parent_status);
/* update the root cgroup regardless */
atomic_long_add_return(amt, prot->memory_allocated);
return memcg_memory_allocated_read(sk->sk_cgrp);
}
+#endif

return atomic_long_add_return(amt, prot->memory_allocated);
}
@@ -1043,9 +1047,11 @@ sk_memory_allocated_sub(struct sock *sk, int amt, int parent_status)
{
struct proto *prot = sk->sk_prot;

+#ifdef CONFIG_INET
if (mem_cgroup_sockets_enabled && sk->sk_cgrp &&
parent_status != OVER_LIMIT) /* Otherwise was uncharged already */
memcg_memory_allocated_sub(sk->sk_cgrp, amt);
+#endif

atomic_long_sub(amt, prot->memory_allocated);
}
--
1.7.7.3

--
Cheers,
Stephen Rothwell sfr@xxxxxxxxxxxxxxxx
http://www.canb.auug.org.au/~sfr/

Attachment: pgp00000.pgp
Description: PGP signature