From: Kirill Tkhai <ktk...@virtuozzo.com>

Do two list_lru_init_memcg() calls after prealloc_super().
destroy_unused_super() in fail path is OK with this.  Next patch needs
such the order.

Link: 
http://lkml.kernel.org/r/153063058712.1818.3382490999719078571.stgit@localhost.localdomain
Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com>
Acked-by: Vladimir Davydov <vdavydov....@gmail.com>
Tested-by: Shakeel Butt <shake...@google.com>
Cc: Al Viro <v...@zeniv.linux.org.uk>
Cc: Andrey Ryabinin <aryabi...@virtuozzo.com>
Cc: Chris Wilson <ch...@chris-wilson.co.uk>
Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
Cc: Guenter Roeck <li...@roeck-us.net>
Cc: "Huang, Ying" <ying.hu...@intel.com>
Cc: Johannes Weiner <han...@cmpxchg.org>
Cc: Josef Bacik <jba...@fb.com>
Cc: Li RongQing <lirongq...@baidu.com>
Cc: Matthew Wilcox <wi...@infradead.org>
Cc: Matthias Kaehlcke <m...@chromium.org>
Cc: Mel Gorman <mgor...@techsingularity.net>
Cc: Michal Hocko <mho...@kernel.org>
Cc: Minchan Kim <minc...@kernel.org>
Cc: Philippe Ombredanne <pombreda...@nexb.com>
Cc: Roman Gushchin <g...@fb.com>
Cc: Sahitya Tummala <stumm...@codeaurora.org>
Cc: Stephen Rothwell <s...@canb.auug.org.au>
Cc: Tetsuo Handa <penguin-ker...@i-love.sakura.ne.jp>
Cc: Thomas Gleixner <t...@linutronix.de>
Cc: Waiman Long <long...@redhat.com>
Signed-off-by: Andrew Morton <a...@linux-foundation.org>
Signed-off-by: Linus Torvalds <torva...@linux-foundation.org>
(cherry picked from commit 2b3648a6ff83bd2a59b427d3537cc570933659b5)
Signed-off-by: Andrey Ryabinin <aryabi...@virtuozzo.com>
---
 fs/super.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/super.c b/fs/super.c
index 9b93f321b9f4..f509d820121f 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -267,10 +267,6 @@ static struct super_block *alloc_super(struct 
file_system_type *type, int flags,
        INIT_LIST_HEAD(&s->s_inodes_wb);
        spin_lock_init(&s->s_inode_wblist_lock);
 
-       if (list_lru_init_memcg(&s->s_dentry_lru))
-               goto fail;
-       if (list_lru_init_memcg(&s->s_inode_lru))
-               goto fail;
        s->s_count = 1;
        atomic_set(&s->s_active, 1);
        mutex_init(&s->s_vfs_rename_mutex);
@@ -288,6 +284,10 @@ static struct super_block *alloc_super(struct 
file_system_type *type, int flags,
        s->s_shrink.flags = SHRINKER_NUMA_AWARE | SHRINKER_MEMCG_AWARE;
        if (prealloc_shrinker(&s->s_shrink))
                goto fail;
+       if (list_lru_init_memcg(&s->s_dentry_lru))
+               goto fail;
+       if (list_lru_init_memcg(&s->s_inode_lru))
+               goto fail;
        return s;
 
 fail:
-- 
2.24.1

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to