diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-10-01 13:11:21 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-10-01 13:11:21 -0400 |
commit | c2d22ecd3cf3c49aeecdc10ffd7af10ec1f7eab6 (patch) | |
tree | cb180b5926c4b81a4385f785c7f0b856f8620fcd /fs | |
parent | 13f3583892cb7afdb2e9eb0207dc4e03ec6f01fd (diff) |
fs/super.c: fix lru_list leak for real
Freeing ->s_{inode,dentry}_lru in deactivate_locked_super() is wrong;
the right place is destroy_super(). As it is, we leak them if sget()
decides that new superblock it has allocated (and never shown to
anybody) isn't needed and should be freed.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/super.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/super.c b/fs/super.c index 3a96c9783a8b..0225c20f8770 100644 --- a/fs/super.c +++ b/fs/super.c | |||
@@ -264,6 +264,8 @@ out_free_sb: | |||
264 | */ | 264 | */ |
265 | static inline void destroy_super(struct super_block *s) | 265 | static inline void destroy_super(struct super_block *s) |
266 | { | 266 | { |
267 | list_lru_destroy(&s->s_dentry_lru); | ||
268 | list_lru_destroy(&s->s_inode_lru); | ||
267 | #ifdef CONFIG_SMP | 269 | #ifdef CONFIG_SMP |
268 | free_percpu(s->s_files); | 270 | free_percpu(s->s_files); |
269 | #endif | 271 | #endif |
@@ -323,8 +325,6 @@ void deactivate_locked_super(struct super_block *s) | |||
323 | 325 | ||
324 | /* caches are now gone, we can safely kill the shrinker now */ | 326 | /* caches are now gone, we can safely kill the shrinker now */ |
325 | unregister_shrinker(&s->s_shrink); | 327 | unregister_shrinker(&s->s_shrink); |
326 | list_lru_destroy(&s->s_dentry_lru); | ||
327 | list_lru_destroy(&s->s_inode_lru); | ||
328 | 328 | ||
329 | put_filesystem(fs); | 329 | put_filesystem(fs); |
330 | put_super(s); | 330 | put_super(s); |