lkml.org 
[lkml]   [2006]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] Add flag __GFP_NOFAIL when allocating block
From
Date
From: Zhang, Yanmin <yanmin.zhang@intel.com>

Function journal_write_metadata_buffer doesn't estimate the return
value of jbd_slab_alloc. If the allocation fails, later jbd_slab_free
or memcpy will cause kernel oops.

Add flag __GFP_NOFAIL when allocating block. The patch is against
2.6.18-mm1.

Signed-off-by: Zhang Yanmin <yanmin.zhang@intel.com>

---

--- linux-2.6.18_mm1/fs/jbd/journal.c 2006-09-29 07:19:49.000000000 -0600
+++ linux-2.6.18_mm1_fix/fs/jbd/journal.c 2006-09-30 03:01:38.000000000 -0600
@@ -329,7 +329,7 @@ repeat:
char *tmp;

jbd_unlock_bh_state(bh_in);
- tmp = jbd_slab_alloc(bh_in->b_size, GFP_NOFS);
+ tmp = jbd_slab_alloc(bh_in->b_size, GFP_NOFS|__GFP_NOFAIL);
jbd_lock_bh_state(bh_in);
if (jh_in->b_frozen_data) {
jbd_slab_free(tmp, bh_in->b_size);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2006-09-29 03:57    [W:0.026 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site