diff options
Diffstat (limited to 'fs/jbd2')
-rw-r--r-- | fs/jbd2/journal.c | 3 | ||||
-rw-r--r-- | fs/jbd2/transaction.c | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 0e329a31c912..f12c65b81456 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c | |||
@@ -654,10 +654,9 @@ static journal_t * journal_init_common (void) | |||
654 | journal_t *journal; | 654 | journal_t *journal; |
655 | int err; | 655 | int err; |
656 | 656 | ||
657 | journal = kmalloc(sizeof(*journal), GFP_KERNEL); | 657 | journal = kzalloc(sizeof(*journal), GFP_KERNEL|__GFP_NOFAIL); |
658 | if (!journal) | 658 | if (!journal) |
659 | goto fail; | 659 | goto fail; |
660 | memset(journal, 0, sizeof(*journal)); | ||
661 | 660 | ||
662 | init_waitqueue_head(&journal->j_wait_transaction_locked); | 661 | init_waitqueue_head(&journal->j_wait_transaction_locked); |
663 | init_waitqueue_head(&journal->j_wait_logspace); | 662 | init_waitqueue_head(&journal->j_wait_logspace); |
diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c index a5fb70fb5621..b1fcf2b3dca3 100644 --- a/fs/jbd2/transaction.c +++ b/fs/jbd2/transaction.c | |||
@@ -96,13 +96,12 @@ static int start_this_handle(journal_t *journal, handle_t *handle) | |||
96 | 96 | ||
97 | alloc_transaction: | 97 | alloc_transaction: |
98 | if (!journal->j_running_transaction) { | 98 | if (!journal->j_running_transaction) { |
99 | new_transaction = kmalloc(sizeof(*new_transaction), | 99 | new_transaction = kzalloc(sizeof(*new_transaction), |
100 | GFP_NOFS|__GFP_NOFAIL); | 100 | GFP_NOFS|__GFP_NOFAIL); |
101 | if (!new_transaction) { | 101 | if (!new_transaction) { |
102 | ret = -ENOMEM; | 102 | ret = -ENOMEM; |
103 | goto out; | 103 | goto out; |
104 | } | 104 | } |
105 | memset(new_transaction, 0, sizeof(*new_transaction)); | ||
106 | } | 105 | } |
107 | 106 | ||
108 | jbd_debug(3, "New handle %p going live.\n", handle); | 107 | jbd_debug(3, "New handle %p going live.\n", handle); |