On Fri, Mar 10, Neil Brown wrote: > -static void prune_dcache(int count) > +static void prune_dcache(int count, struct super_block *sb) > { > spin_lock(&dcache_lock); > for (; count ; count--) { > @@ -417,8 +425,10 @@ static void prune_dcache(int count) > spin_unlock(&dentry->d_lock); > continue; > } > - /* If the dentry was recently referenced, don't free it. */ > - if (dentry->d_flags & DCACHE_REFERENCED) { > + /* If the dentry was recently referenced, or is for > + * a unmounting filesystem, don't free it. */ > + if ((dentry->d_flags & DCACHE_REFERENCED) || > + (dentry->d_sb != sb && dentry->d_sb->s_root == NULL)) { > dentry->d_flags &= ~DCACHE_REFERENCED; > list_add(&dentry->d_lru, &dentry_unused); > dentry_stat.nr_unused++; You have to down_read the rw-semaphore sb->s_umount since sb->s_root is protected by it :( Regards, Jan -- Jan Blunck jblunck@suse.de SuSE LINUX AG - A Novell company Maxfeldstr. 5 +49-911-74053-608 D-90409 Nürnberg http://www.suse.de - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: [PATCH] Fix shrink_dcache_parent() against shrink_dcache_memory() race (3rd updated patch)]
- From: Neil Brown <neilb@suse.de>
- Re: [PATCH] Fix shrink_dcache_parent() against shrink_dcache_memory() race (3rd updated patch)]
- From: Balbir Singh <balbir@in.ibm.com>
- Re: [PATCH] Fix shrink_dcache_parent() against shrink_dcache_memory() race (3rd updated patch)]
- References:
- [PATCH] Fix shrink_dcache_parent() against shrink_dcache_memory() race (3rd updated patch)]
- From: Jan Blunck <jblunck@suse.de>
- Re: [PATCH] Fix shrink_dcache_parent() against shrink_dcache_memory() race (3rd updated patch)]
- From: Kirill Korotaev <dev@openvz.org>
- Re: [PATCH] Fix shrink_dcache_parent() against shrink_dcache_memory() race (3rd updated patch)]
- From: Neil Brown <neilb@suse.de>
- Re: [PATCH] Fix shrink_dcache_parent() against shrink_dcache_memory() race (3rd updated patch)]
- From: Kirill Korotaev <dev@sw.ru>
- Re: [PATCH] Fix shrink_dcache_parent() against shrink_dcache_memory() race (3rd updated patch)]
- From: Jan Blunck <jblunck@suse.de>
- Re: [PATCH] Fix shrink_dcache_parent() against shrink_dcache_memory() race (3rd updated patch)]
- From: Neil Brown <neilb@suse.de>
- [PATCH] Fix shrink_dcache_parent() against shrink_dcache_memory() race (3rd updated patch)]
- Prev by Date: Re: [PATCH -mm3] x86-64: Eliminate register_die_notifier symbol exported twice
- Next by Date: BLK_DEV_INITRD: do not require BLK_DEV_RAM=y
- Previous by thread: Re: [PATCH] Fix shrink_dcache_parent() against shrink_dcache_memory() race (3rd updated patch)]
- Next by thread: Re: [PATCH] Fix shrink_dcache_parent() against shrink_dcache_memory() race (3rd updated patch)]
- Index(es):
![]() |