]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
inode: move inode to a different list inside lock
authorGlauber Costa <glommer@gmail.com>
Thu, 27 Jun 2013 23:52:14 +0000 (09:52 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 28 Jun 2013 06:37:58 +0000 (16:37 +1000)
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>
fs/inode.c

index b91067bdcc3f6a6af22cf626a6af19d37314b299..30b6f55bcaf07a34b6b806eea766bb1a32d2d189 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;
 }