linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: "Theodore Ts'o" <tytso@mit.edu>
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: BUG: unable to handle kernel NULL pointer dereference at 00000000 [ext4_new_meta_blocks+0x7c/0xb7]
Date: Tue, 9 Dec 2008 16:11:22 +0530	[thread overview]
Message-ID: <20081209104121.GA7572@skywalker> (raw)

Hi Ted,

I hit the below Oops with the latest patchqueue.

BUG: unable to handle kernel NULL pointer dereference at 00000000
IP: [<c04c0e39>] ext4_new_meta_blocks+0x7c/0xb7
*pdpt = 0000000011945001 *pde = 0000000000000000
....
....
EAX: da5dae60 EBX: e8c233e0 ECX: d4cb2000 EDX: 00000000
ESI: e8c23114 EDI: e8c2302c EBP: d4cb2b70 ESP: d4cb2b28

The problem is due to remove-do_blk_alloc patch.

The patch below should fix the crash. 


diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
index e950898..2dd1162 100644
--- a/fs/ext4/balloc.c
+++ b/fs/ext4/balloc.c
@@ -650,7 +650,7 @@ ext4_fsblk_t ext4_new_meta_blocks(handle_t *handle, struct inode *inode,
 	 */
 	if (!(*errp) && EXT4_I(inode)->i_delalloc_reserved_flag) {
 		spin_lock(&EXT4_I(inode)->i_block_reservation_lock);
-		EXT4_I(inode)->i_allocated_meta_blocks += *count;
+		EXT4_I(inode)->i_allocated_meta_blocks += ar.len;
 		spin_unlock(&EXT4_I(inode)->i_block_reservation_lock);
 	}
 	return ret;


I have one question regarding the patch. What about blocks allocated for
directories for the  ext3 format.  With extent format we are not
setting EXT4_MB_HINT_DATA for non regular files. So i guess we also
need the below patch .


diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 1647903..89aa870 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -600,7 +600,9 @@ static int ext4_alloc_blocks(handle_t *handle, struct inode *inode,
 	ar.goal = goal;
 	ar.len = target;
 	ar.logical = iblock;
-	ar.flags = EXT4_MB_HINT_DATA;
+	if (S_ISREG(inode->i_mode))
+		/* enable in-core preallocation only for regular files */
+		ar.flags = EXT4_MB_HINT_DATA;
 
 	current_block = ext4_mb_new_blocks(handle, &ar, err);
 

             reply	other threads:[~2008-12-09 10:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-09 10:41 Aneesh Kumar K.V [this message]
2008-12-12 14:56 ` BUG: unable to handle kernel NULL pointer dereference at 00000000 [ext4_new_meta_blocks+0x7c/0xb7] Theodore Tso
2008-12-17  7:56   ` Aneesh Kumar K.V
2008-12-17 11:47     ` Theodore Tso
2008-12-17 16:25       ` Aneesh Kumar K.V
2008-12-18  8:55       ` Andreas Dilger
2009-01-02  5:08 ` 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=20081209104121.GA7572@skywalker \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=linux-ext4@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).