OpenVZ Forum


Home » Mailing lists » Devel » [PATCH 1/4] don't trigger warning when d_subdirs is not empty.
[PATCH 1/4] don't trigger warning when d_subdirs is not empty. [message #45576] Tue, 20 March 2012 16:50
Glauber Costa is currently offline  Glauber Costa
Messages: 916
Registered: October 2011
Senior Member
It is never empty at this point, because of the self references.
a better test is to see if any of them gets d_inode set.

Signed-off-by: Glauber Costa <glommer@parallels.com>
CC: Tejun Heo <tj@kernel.org>
---
kernel/cgroup.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index cf7b298..b45a653 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -947,10 +947,16 @@ static int cgroup_rm_file(struct cgroup *cgrp, const struct cftype *cft)
static void cgroup_clear_directory(struct dentry *dir)
{
struct cgroup *cgrp = __d_cgrp(dir);
+ struct list_head *child;

while (!list_empty(&cgrp->files))
cgroup_rm_file(cgrp, NULL);
- WARN_ON_ONCE(!list_empty(&dir->d_subdirs));
+
+ list_for_each(child, &dir->d_subdirs) {
+ struct dentry *d;
+ d = list_entry(child, struct dentry, d_u.d_child);
+ WARN_ON_ONCE(d->d_inode);
+ }
}

/*
--
1.7.7.6
Previous Topic: Re: [PATCH v2 07/13] memcg: Slab accounting.
Next Topic: [PATCH 0/4] My contribution towards the end of populate()
Goto Forum:
  


Current Time: Mon Nov 18 22:54:43 GMT 2024

Total time taken to generate the page: 0.02949 seconds