From: Lai Jiangshan <laijs@cn.fujitsu.com>
To: Paul Menage <menage@google.com>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Li Zefan <lizf@cn.fujitsu.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH RESEND] cgroups: fix incorrect using rcu_dereference() in cgroup_subsys_state()
Date: Tue, 04 Jan 2011 16:18:06 +0800 [thread overview]
Message-ID: <4D22D7BE.4070702@cn.fujitsu.com> (raw)
From: Li Zefan <lizf@cn.fujitsu.com>
Date: Mon, 25 Aug 2008 11:05:28 +0800
(Original) Subject: [PATCH] cgroup: fix wrong rcu_dereference()
It is tsk->cgroups which is protected by RCU, not ->subsys[subsys_id].
laijs: updated it(the surrounding code have been changed since these two years).
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index ed4ba11..a798814 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -535,10 +535,11 @@ static inline struct cgroup_subsys_state *cgroup_subsys_state(
* cgroup_subsys::attach() methods.
*/
#define task_subsys_state_check(task, subsys_id, __c) \
- rcu_dereference_check(task->cgroups->subsys[subsys_id], \
+ rcu_dereference_check(task->cgroups, \
rcu_read_lock_held() || \
lockdep_is_held(&task->alloc_lock) || \
- cgroup_lock_is_held() || (__c))
+ cgroup_lock_is_held() || \
+ (__c))->subsys[subsys_id]
static inline struct cgroup_subsys_state *
task_subsys_state(struct task_struct *task, int subsys_id)
next reply other threads:[~2011-01-04 8:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-04 8:18 Lai Jiangshan [this message]
2011-01-04 21:23 ` [PATCH RESEND] cgroups: fix incorrect using rcu_dereference() in cgroup_subsys_state() Paul E. McKenney
2011-01-05 1:31 ` Paul Menage
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D22D7BE.4070702@cn.fujitsu.com \
--to=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
--cc=menage@google.com \
--cc=paulmck@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.