diff options
author | Tejun Heo <tj@kernel.org> | 2013-11-27 18:17:27 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2013-11-27 18:17:27 -0500 |
commit | c729b11edf7458a939556e1889446184f42f37a7 (patch) | |
tree | 157c8a20d0c9b0cf9b5835855c9bfe3bfacb98d6 | |
parent | edab95103d3a1eb5e3faf977eae4ad0b5bf5669c (diff) | |
parent | e605b36575e896edd8161534550c9ea021b03bc0 (diff) | |
download | linux-c729b11edf7458a939556e1889446184f42f37a7.tar.gz linux-c729b11edf7458a939556e1889446184f42f37a7.tar.bz2 linux-c729b11edf7458a939556e1889446184f42f37a7.zip |
cgroup: Merge branch 'for-3.13-fixes' into for-3.14
Pull to receive e605b36575e8 ("cgroup: fix cgroup_subsys_state leak
for seq_files") as for-3.14 is scheduled to have a lot of changes
which depend on it.
Signed-off-by: Tejun Heo <tj@kernel.org>
-rw-r--r-- | kernel/cgroup.c | 5 | ||||
-rw-r--r-- | kernel/cpuset.c | 8 |
2 files changed, 10 insertions, 3 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index be42967f4f1a..34fd1be0d9bf 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -166,6 +166,7 @@ static void cgroup_destroy_css_killed(struct cgroup *cgrp); static int cgroup_destroy_locked(struct cgroup *cgrp); static int cgroup_addrm_files(struct cgroup *cgrp, struct cftype cfts[], bool is_add); +static int cgroup_file_release(struct inode *inode, struct file *file); /** * cgroup_css - obtain a cgroup's css for the specified subsystem @@ -2394,7 +2395,7 @@ static const struct file_operations cgroup_seqfile_operations = { .read = seq_read, .write = cgroup_file_write, .llseek = seq_lseek, - .release = single_release, + .release = cgroup_file_release, }; static int cgroup_file_open(struct inode *inode, struct file *file) @@ -2455,6 +2456,8 @@ static int cgroup_file_release(struct inode *inode, struct file *file) ret = cft->release(inode, file); if (css->ss) css_put(css); + if (file->f_op == &cgroup_seqfile_operations) + single_release(inode, file); return ret; } diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 6bf981e13c43..4772034b4b17 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c @@ -1033,8 +1033,10 @@ static void cpuset_change_task_nodemask(struct task_struct *tsk, need_loop = task_has_mempolicy(tsk) || !nodes_intersects(*newmems, tsk->mems_allowed); - if (need_loop) + if (need_loop) { + local_irq_disable(); write_seqcount_begin(&tsk->mems_allowed_seq); + } nodes_or(tsk->mems_allowed, tsk->mems_allowed, *newmems); mpol_rebind_task(tsk, newmems, MPOL_REBIND_STEP1); @@ -1042,8 +1044,10 @@ static void cpuset_change_task_nodemask(struct task_struct *tsk, mpol_rebind_task(tsk, newmems, MPOL_REBIND_STEP2); tsk->mems_allowed = *newmems; - if (need_loop) + if (need_loop) { write_seqcount_end(&tsk->mems_allowed_seq); + local_irq_enable(); + } task_unlock(tsk); } |