From: Akinobu Mita <akinobu.mita@gmail.com>
To: Josef Bacik <jbacik@redhat.com>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
Theodore Tso <tytso@mit.edu>,
adilger@sun.com, linux-ext4@vger.kernel.org
Subject: [PATCH] ext4: fix unhandled ext4_free_data allocation failure
Date: Sun, 11 Jan 2009 11:03:53 +0900 [thread overview]
Message-ID: <20090111020352.GA4285@localhost.localdomain> (raw)
In-Reply-To: <961aa3350812231437x4debaf9byf230a63582561010@mail.gmail.com>
In ext4_mb_free_blocks() ext4_free_data allocation failure
is not handled. This error handling cannot be simple error return because
ext4_mb_free_blocks() cannot fail.
This patch add __GFP_NOFAIL to gfp mask for the allocation.
Cc: Theodore Tso <tytso@mit.edu>
Cc: adilger@sun.com
Cc: linux-ext4@vger.kernel.org
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
fs/ext4/mballoc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: 2.6-git/fs/ext4/mballoc.c
===================================================================
--- 2.6-git.orig/fs/ext4/mballoc.c
+++ 2.6-git/fs/ext4/mballoc.c
@@ -4885,7 +4885,8 @@ do_more:
* blocks being freed are metadata. these blocks shouldn't
* be used until this transaction is committed
*/
- new_entry = kmem_cache_alloc(ext4_free_ext_cachep, GFP_NOFS);
+ new_entry = kmem_cache_alloc(ext4_free_ext_cachep,
+ GFP_NOFS | __GFP_NOFAIL);
new_entry->start_blk = bit;
new_entry->group = block_group;
new_entry->count = count;
next prev parent reply other threads:[~2009-01-11 2:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-23 10:40 [PATCH] ext4: annotate unhandled kmem_cache_alloc() error Akinobu Mita
2008-12-23 14:29 ` Josef Bacik
2008-12-23 22:37 ` Akinobu Mita
2009-01-11 2:03 ` Akinobu Mita [this message]
2009-01-11 14:39 ` [PATCH] ext4: fix unhandled ext4_free_data allocation failure Josef Bacik
2009-01-11 14:46 ` Eric Sandeen
2009-01-12 3:58 ` Theodore Tso
2009-01-12 15:03 ` Theodore Tso
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=20090111020352.GA4285@localhost.localdomain \
--to=akinobu.mita@gmail.com \
--cc=adilger@sun.com \
--cc=akpm@linux-foundation.org \
--cc=jbacik@redhat.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
/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;
as well as URLs for NNTP newsgroup(s).