Commit 05713082 authored by Jan Kara's avatar Jan Kara

jbd: remove dependency on __GFP_NOFAIL

The callers of start_this_handle() (or better ext3_journal_start()) are not
really prepared to handle allocation failures. Such failures can for example
result in silent data loss when it happens in ext3_..._writepage().  OTOH
__GFP_NOFAIL is going away so we just retry allocation in start_this_handle().

This loop is potentially dangerous because the oom killer cannot be invoked
for GFP_NOFS allocation, so there is a potential for infinitely looping.
But still this is better than silent data loss.
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 40680f2f
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/highmem.h> #include <linux/highmem.h>
#include <linux/hrtimer.h> #include <linux/hrtimer.h>
#include <linux/backing-dev.h>
static void __journal_temp_unlink_buffer(struct journal_head *jh); static void __journal_temp_unlink_buffer(struct journal_head *jh);
...@@ -99,11 +100,10 @@ static int start_this_handle(journal_t *journal, handle_t *handle) ...@@ -99,11 +100,10 @@ static int start_this_handle(journal_t *journal, handle_t *handle)
alloc_transaction: alloc_transaction:
if (!journal->j_running_transaction) { if (!journal->j_running_transaction) {
new_transaction = kzalloc(sizeof(*new_transaction), new_transaction = kzalloc(sizeof(*new_transaction), GFP_NOFS);
GFP_NOFS|__GFP_NOFAIL);
if (!new_transaction) { if (!new_transaction) {
ret = -ENOMEM; congestion_wait(BLK_RW_ASYNC, HZ/50);
goto out; goto alloc_transaction;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment