From 5a20869947bc964d70b38b470868a87e9dddc8ca Mon Sep 17 00:00:00 2001 From: Vasily Averin Date: Sat, 28 Oct 2006 10:38:44 -0700 Subject: [PATCH] --- yaml --- r: 40405 b: refs/heads/master c: 6eac3f93f5e6b7256fb20b7608d62ec192da12be h: refs/heads/master i: 40403: cb958b13ed6f445c601524a0e224457b4a1352c5 v: v3 --- [refs] | 2 +- trunk/fs/dcache.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 511a22db2ee5..9973d8d88487 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ebed4bfc8da8df5b6b0bc4a5064a949f04683509 +refs/heads/master: 6eac3f93f5e6b7256fb20b7608d62ec192da12be diff --git a/trunk/fs/dcache.c b/trunk/fs/dcache.c index a1ff91eef108..a5b76b647c6d 100644 --- a/trunk/fs/dcache.c +++ b/trunk/fs/dcache.c @@ -478,11 +478,12 @@ static void prune_dcache(int count, struct super_block *sb) up_read(s_umount); } spin_unlock(&dentry->d_lock); - /* Cannot remove the first dentry, and it isn't appropriate - * to move it to the head of the list, so give up, and try - * later + /* + * Insert dentry at the head of the list as inserting at the + * tail leads to a cycle. */ - break; + list_add(&dentry->d_lru, &dentry_unused); + dentry_stat.nr_unused++; } spin_unlock(&dcache_lock); }