diff options
author | Theodore Ts'o <tytso@mit.edu> | 2009-12-01 09:04:42 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-12-01 09:04:42 -0500 |
commit | e6ec116b67f46e0e7808276476554727b2e6240b (patch) | |
tree | ef80d636a8d45ff7779532e493916e2873adf390 /fs/jbd2/journal.c | |
parent | 3f0ca309858ee186435c608ee9eaafd1c8dcb53a (diff) |
jbd2: Add ENOMEM checking in and for jbd2_journal_write_metadata_buffer()
OOM happens.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/jbd2/journal.c')
-rw-r--r-- | fs/jbd2/journal.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index af60d98ddd22..3f473faa4660 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c | |||
@@ -358,6 +358,10 @@ repeat: | |||
358 | 358 | ||
359 | jbd_unlock_bh_state(bh_in); | 359 | jbd_unlock_bh_state(bh_in); |
360 | tmp = jbd2_alloc(bh_in->b_size, GFP_NOFS); | 360 | tmp = jbd2_alloc(bh_in->b_size, GFP_NOFS); |
361 | if (!tmp) { | ||
362 | jbd2_journal_put_journal_head(new_jh); | ||
363 | return -ENOMEM; | ||
364 | } | ||
361 | jbd_lock_bh_state(bh_in); | 365 | jbd_lock_bh_state(bh_in); |
362 | if (jh_in->b_frozen_data) { | 366 | if (jh_in->b_frozen_data) { |
363 | jbd2_free(tmp, bh_in->b_size); | 367 | jbd2_free(tmp, bh_in->b_size); |