diff options
author | Chengguang Xu <cgxu519@gmail.com> | 2019-05-10 21:15:47 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-05-22 07:37:44 +0200 |
commit | 5b8567682489dbbb0742c9fc3f6711bb6a01f540 (patch) | |
tree | a6001b5c476c3b30f36ca53e987e8af76d874673 /include/linux/jbd2.h | |
parent | 95482af27161083976c7f5bdf347992deb3767ce (diff) | |
download | linux-stable-5b8567682489dbbb0742c9fc3f6711bb6a01f540.tar.gz linux-stable-5b8567682489dbbb0742c9fc3f6711bb6a01f540.tar.bz2 linux-stable-5b8567682489dbbb0742c9fc3f6711bb6a01f540.zip |
jbd2: fix potential double free
commit 0d52154bb0a700abb459a2cbce0a30fc2549b67e upstream.
When failing from creating cache jbd2_inode_cache, we will destroy the
previously created cache jbd2_handle_cache twice. This patch fixes
this by moving each cache initialization/destruction to its own
separate, individual function.
Signed-off-by: Chengguang Xu <cgxu519@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/jbd2.h')
-rw-r--r-- | include/linux/jbd2.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index b708e5169d1d..583b82b5a1e9 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h @@ -1317,7 +1317,7 @@ extern void __wait_on_journal (journal_t *); /* Transaction cache support */ extern void jbd2_journal_destroy_transaction_cache(void); -extern int jbd2_journal_init_transaction_cache(void); +extern int __init jbd2_journal_init_transaction_cache(void); extern void jbd2_journal_free_transaction(transaction_t *); /* @@ -1445,8 +1445,10 @@ static inline void jbd2_free_inode(struct jbd2_inode *jinode) /* Primary revoke support */ #define JOURNAL_REVOKE_DEFAULT_HASH 256 extern int jbd2_journal_init_revoke(journal_t *, int); -extern void jbd2_journal_destroy_revoke_caches(void); -extern int jbd2_journal_init_revoke_caches(void); +extern void jbd2_journal_destroy_revoke_record_cache(void); +extern void jbd2_journal_destroy_revoke_table_cache(void); +extern int __init jbd2_journal_init_revoke_record_cache(void); +extern int __init jbd2_journal_init_revoke_table_cache(void); extern void jbd2_journal_destroy_revoke(journal_t *); extern int jbd2_journal_revoke (handle_t *, unsigned long long, struct buffer_head *); |