super: fix for destroy lrus
authorGlauber Costa <glommer@gmail.com>
Wed, 28 Aug 2013 00:18:18 +0000 (10:18 +1000)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 10 Sep 2013 22:56:32 +0000 (18:56 -0400)
This patch adds the missing call to list_lru_destroy (spotted by Li Zhong)
and moves the deletion to after the shrinker is unregistered, as correctly
spotted by Dave

Signed-off-by: Glauber Costa <glommer@openvz.org>
Cc: 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/super.c
fs/xfs/xfs_buf.c
fs/xfs/xfs_qm.c

index 269d96857caa1dfc9bf41161d1e79ad074d06884..3a96c9783a8b959015af96e0b0548bd8e51cc606 100644 (file)
@@ -323,6 +323,9 @@ void deactivate_locked_super(struct super_block *s)
 
                /* caches are now gone, we can safely kill the shrinker now */
                unregister_shrinker(&s->s_shrink);
+               list_lru_destroy(&s->s_dentry_lru);
+               list_lru_destroy(&s->s_inode_lru);
+
                put_filesystem(fs);
                put_super(s);
        } else {
index 49fdb7bed4812f9b348f8e4592beeba49ac0f1ac..263470075ea2ce11dd39a83603e0b9fa1f0f5a60 100644 (file)
@@ -1592,8 +1592,8 @@ xfs_free_buftarg(
        struct xfs_mount        *mp,
        struct xfs_buftarg      *btp)
 {
-       list_lru_destroy(&btp->bt_lru);
        unregister_shrinker(&btp->bt_shrinker);
+       list_lru_destroy(&btp->bt_lru);
 
        if (mp->m_flags & XFS_MOUNT_BARRIER)
                xfs_blkdev_issue_flush(btp);
index 7f4138629a8022ed09f1a3ed5ae62f1e169d3ae5..3e6c2e6c9cd24d145514c95b7357ce91acc219f0 100644 (file)
@@ -940,8 +940,8 @@ xfs_qm_destroy_quotainfo(
        qi = mp->m_quotainfo;
        ASSERT(qi != NULL);
 
-       list_lru_destroy(&qi->qi_lru);
        unregister_shrinker(&qi->qi_shrinker);
+       list_lru_destroy(&qi->qi_lru);
 
        if (qi->qi_uquotaip) {
                IRELE(qi->qi_uquotaip);