aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jbd
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2011-05-26 11:17:18 -0400
committerJan Kara <jack@suse.cz>2011-06-25 11:29:51 -0400
commit05713082ab7690a2b22b044cfc867f346c39cd2d (patch)
treed69117ce69b53c5c51011595def5664210513437 /fs/jbd
parent40680f2fa4670ab35ee554822a69dda1a118f966 (diff)
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: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/jbd')
-rw-r--r--fs/jbd/transaction.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/jbd/transaction.c b/fs/jbd/transaction.c
index f7ee81a065da..83a661890868 100644
--- a/fs/jbd/transaction.c
+++ b/fs/jbd/transaction.c
@@ -26,6 +26,7 @@
26#include <linux/mm.h> 26#include <linux/mm.h>
27#include <linux/highmem.h> 27#include <linux/highmem.h>
28#include <linux/hrtimer.h> 28#include <linux/hrtimer.h>
29#include <linux/backing-dev.h>
29 30
30static void __journal_temp_unlink_buffer(struct journal_head *jh); 31static void __journal_temp_unlink_buffer(struct journal_head *jh);
31 32
@@ -99,11 +100,10 @@ static int start_this_handle(journal_t *journal, handle_t *handle)
99 100
100alloc_transaction: 101alloc_transaction:
101 if (!journal->j_running_transaction) { 102 if (!journal->j_running_transaction) {
102 new_transaction = kzalloc(sizeof(*new_transaction), 103 new_transaction = kzalloc(sizeof(*new_transaction), GFP_NOFS);
103 GFP_NOFS|__GFP_NOFAIL);
104 if (!new_transaction) { 104 if (!new_transaction) {
105 ret = -ENOMEM; 105 congestion_wait(BLK_RW_ASYNC, HZ/50);
106 goto out; 106 goto alloc_transaction;
107 } 107 }
108 } 108 }
109 109