fs: dcache fix LRU ordering
authornpiggin@suse.de <npiggin@suse.de>
Sun, 26 Apr 2009 10:25:53 +0000 (20:25 +1000)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 9 May 2009 14:49:40 +0000 (10:49 -0400)
Fix ordering of LRU when moving referenced dentries to the head of the list
(they should go to the head of the list in the same order as they were found
from the tail, rather than reverse order).

Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/dcache.c

index 1fcffeb..75659a6 100644 (file)
@@ -481,7 +481,7 @@ restart:
                        if ((flags & DCACHE_REFERENCED)
                                && (dentry->d_flags & DCACHE_REFERENCED)) {
                                dentry->d_flags &= ~DCACHE_REFERENCED;
-                               list_move_tail(&dentry->d_lru, &referenced);
+                               list_move(&dentry->d_lru, &referenced);
                                spin_unlock(&dentry->d_lock);
                        } else {
                                list_move_tail(&dentry->d_lru, &tmp);