From b8e50f43b00557d459255c7af7577e9820fed1f0 Mon Sep 17 00:00:00 2001 From: David Howells Date: Tue, 7 Jun 2011 14:09:30 +0100 Subject: [PATCH] --- yaml --- r: 262077 b: refs/heads/master c: 43c1c9cd244098012441b90c32304f11f1258d43 h: refs/heads/master i: 262075: 85c91eb4664085f0a9cf1d199b05f9dc0d253476 v: v3 --- [refs] | 2 +- trunk/fs/dcache.c | 22 +++++----------------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/[refs] b/[refs] index dc515171e6f6..3c1a8479a604 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c6627c60c07c43b51ef88e352627fa786d1e1592 +refs/heads/master: 43c1c9cd244098012441b90c32304f11f1258d43 diff --git a/trunk/fs/dcache.c b/trunk/fs/dcache.c index 9df8b861e18e..2347cdb15abb 100644 --- a/trunk/fs/dcache.c +++ b/trunk/fs/dcache.c @@ -842,33 +842,21 @@ static void shrink_dcache_for_umount_subtree(struct dentry *dentry) BUG_ON(!IS_ROOT(dentry)); - /* detach this root from the system */ - dentry_lru_del(dentry); - __d_shrink(dentry); - for (;;) { /* descend to the first leaf in the current subtree */ - while (!list_empty(&dentry->d_subdirs)) { - struct dentry *loop; - - /* this is a branch with children - detach all of them - * from the system in one go */ - list_for_each_entry(loop, &dentry->d_subdirs, - d_u.d_child) { - dentry_lru_del(loop); - __d_shrink(loop); - } - - /* move to the first child */ + while (!list_empty(&dentry->d_subdirs)) dentry = list_entry(dentry->d_subdirs.next, struct dentry, d_u.d_child); - } /* consume the dentries from this leaf up through its parents * until we find one with children or run out altogether */ do { struct inode *inode; + /* detach from the system */ + dentry_lru_del(dentry); + __d_shrink(dentry); + if (dentry->d_count != 0) { printk(KERN_ERR "BUG: Dentry %p{i=%lx,n=%s}"