All of lore.kernel.org
 help / color / mirror / Atom feed
* BUG: unable to handle kernel NULL pointer dereference at 00000000 [ext4_new_meta_blocks+0x7c/0xb7]
@ 2008-12-09 10:41 Aneesh Kumar K.V
  2008-12-12 14:56 ` Theodore Tso
  2009-01-02  5:08 ` Theodore Tso
  0 siblings, 2 replies; 7+ messages in thread
From: Aneesh Kumar K.V @ 2008-12-09 10:41 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: Ext4 Developers List

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);
 

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-01-02  5:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-09 10:41 BUG: unable to handle kernel NULL pointer dereference at 00000000 [ext4_new_meta_blocks+0x7c/0xb7] Aneesh Kumar K.V
2008-12-12 14:56 ` 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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.