mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: "Zhang, Yanmin" <yanmin_zhang@linux.intel.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Add flag __GFP_NOFAIL when allocating block
Date: Thu, 28 Sep 2006 23:10:33 -0700	[thread overview]
Message-ID: <20060928231033.ff2d022b.akpm@osdl.org> (raw)
In-Reply-To: <1159494812.20092.727.camel@ymzhang-perf.sh.intel.com>

On Fri, 29 Sep 2006 09:53:33 +0800
"Zhang, Yanmin" <yanmin_zhang@linux.intel.com> wrote:

> 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_slab_alloc() does that internally.

      reply	other threads:[~2006-09-29  6:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-29  1:53 Zhang, Yanmin
2006-09-29  6:10 ` Andrew Morton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060928231033.ff2d022b.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yanmin_zhang@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®