|
@@ -2994,6 +2994,7 @@ static void cgroup_event_remove(struct work_struct *work)
|
|
|
|
|
|
eventfd_ctx_put(event->eventfd);
|
|
|
kfree(event);
|
|
|
+ dput(cgrp->dentry);
|
|
|
}
|
|
|
|
|
|
/*
|
|
@@ -3114,6 +3115,13 @@ static int cgroup_write_event_control(struct cgroup *cgrp, struct cftype *cft,
|
|
|
goto fail;
|
|
|
}
|
|
|
|
|
|
+ /*
|
|
|
+ * Events should be removed after rmdir of cgroup directory, but before
|
|
|
+ * destroying subsystem state objects. Let's take reference to cgroup
|
|
|
+ * directory dentry to do that.
|
|
|
+ */
|
|
|
+ dget(cgrp->dentry);
|
|
|
+
|
|
|
spin_lock(&cgrp->event_list_lock);
|
|
|
list_add(&event->list, &cgrp->event_list);
|
|
|
spin_unlock(&cgrp->event_list_lock);
|