]> git.baikalelectronics.ru Git - kernel.git/commit
net: fix sock_clone reference mismatch with tcp memcontrol
authorGlauber Costa <glommer@parallels.com>
Thu, 5 Jan 2012 20:16:39 +0000 (20:16 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 7 Jan 2012 18:16:34 +0000 (10:16 -0800)
commit18fade1f06faba794679339bf083652cc97fda94
treebedb8b38bec1bdb3fa7159bc61822488984d3ce0
parent1d88677a64331fda117eb3310eaa1f9727e74d18
net: fix sock_clone reference mismatch with tcp memcontrol

Sockets can also be created through sock_clone. Because it copies
all data in the sock structure, it also copies the memcg-related pointer,
and all should be fine. However, since we now use reference counts in
socket creation, we are left with some sockets that have no reference
counts. It matters when we destroy them, since it leads to a mismatch.

Signed-off-by: Glauber Costa <glommer@parallels.com>
CC: David S. Miller <davem@davemloft.net>
CC: Greg Thelen <gthelen@google.com>
CC: Hiroyouki Kamezawa <kamezawa.hiroyu@jp.fujitsu.com>
CC: Laurent Chavey <chavey@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sock.h
mm/memcontrol.c
net/core/sock.c