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 PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Sun, 5 May 2019 19:01:03 +0800 From: Chengguang Xu <cgxu519@...il.com> To: jack@...e.com, tytso@....edu Cc: linux-ext4@...r.kernel.org, linux-kernel@...r.kernel.org, Chengguang Xu <cgxu519@...il.com> Subject: [PATCH 2/3] jbd2: code cleanup for jbd2_journal_init_revoke_caches() jbd2_journal_destroy_caches() can handle destruction work for all caches, so we don't have to destroy previously created cache in error path, it also makes the code simpler. Signed-off-by: Chengguang Xu <cgxu519@...il.com> --- fs/jbd2/revoke.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/jbd2/revoke.c b/fs/jbd2/revoke.c index a1143e57a718..3b46b45d085d 100644 --- a/fs/jbd2/revoke.c +++ b/fs/jbd2/revoke.c @@ -194,17 +194,14 @@ int __init jbd2_journal_init_revoke_caches(void) jbd2_revoke_record_cache = KMEM_CACHE(jbd2_revoke_record_s, SLAB_HWCACHE_ALIGN|SLAB_TEMPORARY); if (!jbd2_revoke_record_cache) - goto record_cache_failure; + return -ENOMEM; jbd2_revoke_table_cache = KMEM_CACHE(jbd2_revoke_table_s, SLAB_TEMPORARY); if (!jbd2_revoke_table_cache) - goto table_cache_failure; - return 0; -table_cache_failure: - jbd2_journal_destroy_revoke_caches(); -record_cache_failure: return -ENOMEM; + + return 0; } static struct jbd2_revoke_table_s *jbd2_journal_init_revoke_table(int hash_size) -- 2.20.1
Powered by blists - more mailing lists