]> git.hungrycats.org Git - linux/commitdiff
Fix shrink_dcache_anon() LRU list accesses.
authorLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 5 Aug 2004 13:30:40 +0000 (06:30 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 5 Aug 2004 13:30:40 +0000 (06:30 -0700)
It would potentially remove dentries from the LRU list
without re-initializing the d_lru fields, causing later
accesses to that dentry to do bad things to the LRU list.

fs/dcache.c

index ac36b5c5fdf23f3eb55c9d4cf5d651065e0c9909..425c2e5689483940c9d8ab1d78850a33cc91c61d 100644 (file)
@@ -628,7 +628,7 @@ void shrink_dcache_anon(struct hlist_head *head)
                        struct dentry *this = hlist_entry(lp, struct dentry, d_hash);
                        if (!list_empty(&this->d_lru)) {
                                dentry_stat.nr_unused--;
-                               list_del(&this->d_lru);
+                               list_del_init(&this->d_lru);
                        }
 
                        /*