futex,plist: Pass the real head of the priority list to plist_del()
authorLai Jiangshan <laijs@cn.fujitsu.com>
Wed, 22 Dec 2010 06:18:50 +0000 (14:18 +0800)
committerSteven Rostedt <rostedt@goodmis.org>
Fri, 11 Mar 2011 20:09:52 +0000 (15:09 -0500)
commit2e12978a9f7a7abd54e8eb9ce70a7718767b8b2c
treeeb4f298e084b5bcc4922511237cd6ce2e158abdd
parenta5abba989deceb731047425812d268daf7536575
futex,plist: Pass the real head of the priority list to plist_del()

Some plist_del()s in kernel/futex.c are passed a faked head of the
priority list.

It does not fail because the current code does not require the real head
in plist_del(). The current code of plist_del() just uses the head for checking,
so it will not cause a bad result even when we use a faked head.

But it is undocumented usage:

/**
 * plist_del - Remove a @node from plist.
 *
 * @node: &struct plist_node pointer - entry to be removed
 * @head: &struct plist_head pointer - list head
 */

The document says that the @head is the "list head" head of the priority list.

In futex code, several places use "plist_del(&q->list, &q->list.plist);",
they pass a fake head. We need to fix them all.

Thanks to Darren Hart for many suggestions.

Acked-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
LKML-Reference: <4D11984A.5030203@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/futex.c