Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350334
b: refs/heads/master
c: f169007
h: refs/heads/master
v: v3
  • Loading branch information
Li Zefan authored and Tejun Heo committed Feb 18, 2013
1 parent 8db9997 commit 906c156
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 810cbee4fad570ff167132d4ecf247d99c48f71d
refs/heads/master: f169007b2773f285e098cb84c74aac0154d65ff7
11 changes: 11 additions & 0 deletions trunk/kernel/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -3856,6 +3856,7 @@ static int cgroup_write_event_control(struct cgroup *cgrp, struct cftype *cft,
const char *buffer)
{
struct cgroup_event *event = NULL;
struct cgroup *cgrp_cfile;
unsigned int efd, cfd;
struct file *efile = NULL;
struct file *cfile = NULL;
Expand Down Expand Up @@ -3911,6 +3912,16 @@ static int cgroup_write_event_control(struct cgroup *cgrp, struct cftype *cft,
goto fail;
}

/*
* The file to be monitored must be in the same cgroup as
* cgroup.event_control is.
*/
cgrp_cfile = __d_cgrp(cfile->f_dentry->d_parent);
if (cgrp_cfile != cgrp) {
ret = -EINVAL;
goto fail;
}

if (!event->cft->register_event || !event->cft->unregister_event) {
ret = -EINVAL;
goto fail;
Expand Down

0 comments on commit 906c156

Please sign in to comment.