lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <153365635538.19074.16684830171993560909.stgit@localhost.localdomain>
Date:   Tue, 07 Aug 2018 18:39:15 +0300
From:   Kirill Tkhai <ktkhai@...tuozzo.com>
To:     akpm@...ux-foundation.org, gregkh@...uxfoundation.org,
        rafael@...nel.org, viro@...iv.linux.org.uk,
        darrick.wong@...cle.com, paulmck@...ux.vnet.ibm.com,
        josh@...htriplett.org, rostedt@...dmis.org,
        mathieu.desnoyers@...icios.com, jiangshanlai@...il.com,
        hughd@...gle.com, shuah@...nel.org, robh@...nel.org,
        ulf.hansson@...aro.org, aspriel@...il.com,
        vivek.gautam@...eaurora.org, robin.murphy@....com, joe@...ches.com,
        heikki.krogerus@...ux.intel.com, ktkhai@...tuozzo.com,
        sfr@...b.auug.org.au, vdavydov.dev@...il.com, mhocko@...e.com,
        chris@...is-wilson.co.uk, penguin-kernel@...ove.SAKURA.ne.jp,
        aryabinin@...tuozzo.com, willy@...radead.org, ying.huang@...el.com,
        shakeelb@...gle.com, jbacik@...com, mingo@...nel.org,
        mhiramat@...nel.org, linux-kernel@...r.kernel.org,
        linux-fsdevel@...r.kernel.org, linux-mm@...ck.org
Subject: [PATCH RFC 09/10] shmem: Implement shmem_destroy_super()

Similar to xfs_fs_destroy_super() implement the method
for shmem.

shmem_unused_huge_count() just touches sb->s_fs_info.
After such the later freeing it will be safe for
unregister_shrinker() splitting (which is made in next
patch).

Signed-off-by: Kirill Tkhai <ktkhai@...tuozzo.com>
---
 mm/shmem.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/mm/shmem.c b/mm/shmem.c
index 4829798869b6..35c65afefbc8 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -3427,6 +3427,12 @@ static void shmem_put_super(struct super_block *sb)
 
 	percpu_counter_destroy(&sbinfo->used_blocks);
 	mpol_put(sbinfo->mpol);
+}
+
+static void shmem_destroy_super(struct super_block *sb)
+{
+	struct shmem_sb_info *sbinfo = SHMEM_SB(sb);
+
 	kfree(sbinfo);
 	sb->s_fs_info = NULL;
 }
@@ -3504,6 +3510,7 @@ int shmem_fill_super(struct super_block *sb, void *data, size_t data_size,
 
 failed:
 	shmem_put_super(sb);
+	shmem_destroy_super(sb);
 	return err;
 }
 
@@ -3630,6 +3637,7 @@ static const struct super_operations shmem_ops = {
 	.evict_inode	= shmem_evict_inode,
 	.drop_inode	= generic_delete_inode,
 	.put_super	= shmem_put_super,
+	.destroy_super	= shmem_destroy_super,
 #ifdef CONFIG_TRANSPARENT_HUGE_PAGECACHE
 	.nr_cached_objects	= shmem_unused_huge_count,
 	.free_cached_objects	= shmem_unused_huge_scan,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ