inode: move inode to a different list inside lock
authorGlauber Costa <glommer@gmail.com>
Wed, 28 Aug 2013 00:17:59 +0000 (10:17 +1000)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 10 Sep 2013 22:56:30 +0000 (18:56 -0400)
When removing an element from the lru, this will be done today after the lock
is released. This is a clear mistake, although we are not sure if the bugs we
are seeing are related to this. All list manipulations are done inside the
lock, and so should this one.

Signed-off-by: Glauber Costa <glommer@openvz.org>
Tested-by: Michal Hocko <mhocko@suse.cz>
Cc: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/inode.c

index a973d268c15768cf594db0d8ea8796189e87af86..5b1ec47c5d398712e77bfed9e288188e03f9c1d3 100644 (file)
@@ -735,9 +735,9 @@ inode_lru_isolate(struct list_head *item, spinlock_t *lru_lock, void *arg)
 
        WARN_ON(inode->i_state & I_NEW);
        inode->i_state |= I_FREEING;
+       list_move(&inode->i_lru, freeable);
        spin_unlock(&inode->i_lock);
 
-       list_move(&inode->i_lru, freeable);
        this_cpu_dec(nr_unused);
        return LRU_REMOVED;
 }