Home » Mailing lists » Devel » [Q] missing unused dentry in prune_dcache()?
Re: [Q] missing unused dentry in prune_dcache()? [message #7837 is a reply to message #7815] |
Fri, 27 October 2006 06:32   |
vaverin
Messages: 708 Registered: September 2005
|
Senior Member |
|
|
David Howells wrote:
> Vasily Averin <vvs@sw.ru> wrote:
>
>> I've noticed one more minor issue in your patch: in
>> shrink_dcache_for_umount_subtree() function you decrement
>> dentry_stat.nr_dentry without dcache_lock.
>
> How about the attached patch?
I'm sorry, but your patch is wrong:
you have mixed calculation of 2 variables:
dentry_stat.nr_unused -- were correct, it was decremented under dcache_lock.
dentry_stat.nr_dentry -- were incorrect, it was decremented without dcache_lock.
You should correct dentry_stat.nr_dentry, but instead you broke calculation of
dentry_stat.nr_unused.
I've fixed this issue by following patch.
Thank you,
Vasily Averin
---
VFS: Fix an error in dentry_stat.nr_dentry counting
From: Vasily Averin <vvs@sw.ru>
Fix an error in dentry_stat.nr_dentry counting in
shrink_dcache_for_umount_subtree() in which the count is modified without the
dcache_lock held.
Signed-Off-By: Vasily Averin <vvs@sw.ru>
--- linux-2.6.19-rc3/fs/dcache.c.nrdntr 2006-10-26 15:14:51.000000000 +0400
+++ linux-2.6.19-rc3/fs/dcache.c 2006-10-27 10:24:07.000000000 +0400
@@ -554,6 +554,7 @@ repeat:
static void shrink_dcache_for_umount_subtree(struct dentry *dentry)
{
struct dentry *parent;
+ unsigned detached = 0;
BUG_ON(!IS_ROOT(dentry));
@@ -618,7 +619,7 @@ static void shrink_dcache_for_umount_sub
atomic_dec(&parent->d_count);
list_del(&dentry->d_u.d_child);
- dentry_stat.nr_dentry--; /* For d_free, below */
+ detached++;
inode = dentry->d_inode;
if (inode) {
@@ -635,8 +636,8 @@ static void shrink_dcache_for_umount_sub
/* finished when we fall off the top of the tree,
* otherwise we ascend to the parent and move to the
* next sibling if there is one */
- if (!parent)
- return;
+ if (!parent)
+ goto out;
dentry = parent;
@@ -645,6 +646,11 @@ static void shrink_dcache_for_umount_sub
dentry = list_entry(dentry->d_subdirs.next,
struct dentry, d_u.d_child);
}
+out:
+ /* several dentries were freed, need to correct nr_dentry */
+ spin_lock(&dcache_lock);
+ dentry_stat.nr_dentry -= detached;
+ spin_unlock(&dcache_lock);
}
/*
|
|
|
 |
|
[Q] missing unused dentry in prune_dcache()?
By: vaverin on Wed, 25 October 2006 12:30
|
 |
|
Re: [Q] missing unused dentry in prune_dcache()?
By: vaverin on Wed, 25 October 2006 13:58
|
 |
|
Re: [Q] missing unused dentry in prune_dcache()?
|
 |
|
Re: [Q] missing unused dentry in prune_dcache()?
By: vaverin on Thu, 26 October 2006 11:36
|
 |
|
Re: [Q] missing unused dentry in prune_dcache()?
|
 |
|
Re: [Q] missing unused dentry in prune_dcache()?
By: vaverin on Fri, 27 October 2006 08:05
|
 |
|
Re: [Q] missing unused dentry in prune_dcache()?
|
 |
|
Re: [Q] missing unused dentry in prune_dcache()?
By: vaverin on Fri, 27 October 2006 11:50
|
 |
|
Re: [Q] missing unused dentry in prune_dcache()?
|
 |
|
Re: [Q] missing unused dentry in prune_dcache()?
By: vaverin on Fri, 27 October 2006 13:47
|
 |
|
Re: [Q] missing unused dentry in prune_dcache()?
|
 |
|
Re: [Q] missing unused dentry in prune_dcache()?
By: dev on Fri, 27 October 2006 14:34
|
 |
|
[PATCH 2.6.19-rc3] VFS: per-sb dentry lru list
By: vaverin on Fri, 27 October 2006 14:05
|
 |
|
Re: [PATCH 2.6.19-rc3] VFS: per-sb dentry lru list
|
 |
|
Re: [PATCH 2.6.19-rc3] VFS: per-sb dentry lru list
By: vaverin on Mon, 30 October 2006 14:24
|
 |
|
Re: [PATCH 2.6.19-rc3] VFS: per-sb dentry lru list
|
 |
|
Re: [PATCH 2.6.19-rc3] VFS: per-sb dentry lru list
By: dev on Mon, 30 October 2006 15:27
|
 |
|
Re: [PATCH 2.6.19-rc3] VFS: per-sb dentry lru list
|
 |
|
Re: [PATCH 2.6.19-rc3] VFS: per-sb dentry lru list
By: dev on Mon, 30 October 2006 15:06
|
 |
|
Re: [PATCH 2.6.19-rc3] VFS: per-sb dentry lru list
|
 |
|
Re: Re: [PATCH 2.6.19-rc3] VFS: per-sb dentry lru list
By: dev on Mon, 30 October 2006 06:22
|
 |
|
Re: Re: [PATCH 2.6.19-rc3] VFS: per-sb dentry lru list
|
 |
|
Re: Re: [PATCH 2.6.19-rc3] VFS: per-sb dentry lru list
|
 |
|
Re: Re: [PATCH 2.6.19-rc3] VFS: per-sb dentry lru list
|
 |
|
Re: Re: [PATCH 2.6.19-rc3] VFS: per-sb dentry lru list
By: vaverin on Wed, 01 November 2006 13:32
|
 |
|
Re: Re: [PATCH 2.6.19-rc3] VFS: per-sb dentry lru list
|
 |
|
Re: [PATCH 2.6.19-rc3] VFS: per-sb dentry lru list
By: vaverin on Tue, 14 November 2006 06:12
|
 |
|
Re: [PATCH 2.6.19-rc3] VFS: per-sb dentry lru list
By: vaverin on Tue, 31 October 2006 13:08
|
 |
|
Re: Re: [PATCH 2.6.19-rc3] VFS: per-sb dentry lru list
By: dev on Wed, 01 November 2006 10:48
|
 |
|
Re: Re: [PATCH 2.6.19-rc3] VFS: per-sb dentry lru list
|
 |
|
Re: Re: [PATCH 2.6.19-rc3] VFS: per-sb dentry lru list
|
 |
|
[PATCH 2.6.19-rc3] VFS: missing unused dentry in prune_dcache()
By: vaverin on Fri, 27 October 2006 13:42
|
 |
|
Re: [PATCH 2.6.19-rc3] VFS: missing unused dentry in prune_dcache()
|
 |
|
Re: [Q] missing unused dentry in prune_dcache()?
|
 |
|
Re: [Q] missing unused dentry in prune_dcache()?
By: vaverin on Thu, 26 October 2006 11:49
|
 |
|
Re: [Q] missing unused dentry in prune_dcache()?
|
 |
|
Re: [Q] missing unused dentry in prune_dcache()?
|
 |
|
Re: [Q] missing unused dentry in prune_dcache()?
By: vaverin on Thu, 26 October 2006 13:58
|
 |
|
Re: [Q] missing unused dentry in prune_dcache()?
|
 |
|
Re: [Q] missing unused dentry in prune_dcache()?
By: vaverin on Fri, 27 October 2006 06:32
|
 |
|
Re: [Q] missing unused dentry in prune_dcache()?
By: vaverin on Fri, 27 October 2006 06:50
|
 |
|
Re: [Q] missing unused dentry in prune_dcache()?
|
 |
|
[Q] missing ->d_delete() in shrink_dcache_for_umount()?
By: vaverin on Tue, 31 October 2006 13:24
|
 |
|
Re: [Q] missing ->d_delete() in shrink_dcache_for_umount()?
|
Goto Forum:
Current Time: Sat Jul 05 09:19:34 GMT 2025
Total time taken to generate the page: 0.03319 seconds
|