jbd2: fix potential double free
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
This commit is contained in:

committed by
Theodore Ts'o

parent
592acbf168
commit
0d52154bb0
@@ -1318,7 +1318,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 *);
|
||||
|
||||
/*
|
||||
@@ -1446,8 +1446,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 *);
|
||||
|
Reference in New Issue
Block a user