Hi,

On Tue, 06 Jul 2010 11:02:41 +0200, Łukasz_Wójcicki wrote:
> I'am using kernel 2.6.20 with nilf_utils-2-0-18 and nilfs kernel module
> 2-0-20 .
> 
> <1>Unable to handle kernel NULL pointer dereference at virtual address
> 00000000
> <1>pgd = c4eb0000
> <1>[00000000] *pgd=c4e2d031, *pte=00000000, *ppte=00000000
> <4>Internal error: Oops: 17 [#1]
> <4>Modules linked in:
> <4>CPU: 0
> <4>PC is at nilfs_btree_lookup_dirty_buffers+0x10c/0x1ec
> <4>LR is at 0xc4c99b24
<snip>

Could you try the following patch to narrow down the cause?

There is a function lacking range check in the btree code.  This patch
will catch the defect if the oops comes from a range error.

I'm now reviewing the btree code to find out root cause of the range
error.

Thanks,
Ryusuke Konishi
---

diff --git a/fs/btree.c b/fs/btree.c
index beb11fe..9622ff4 100644
--- a/fs/btree.c
+++ b/fs/btree.c
@@ -2007,6 +2007,15 @@ static void nilfs_btree_add_dirty_buffer(struct 
nilfs_btree *btree,
        node = (struct nilfs_btree_node *)bh->b_data;
        key = nilfs_btree_node_get_key(node, 0);
        level = nilfs_btree_node_get_level(node);
+       if (level < NILFS_BTREE_LEVEL_NODE_MIN ||
+           level >= NILFS_BTREE_LEVEL_MAX) {
+               dump_stack();
+               printk(KERN_CRIT
+                      "%s: invalid btree level: %d (ino=%lu)\n", __func__,
+                      level, NILFS_BMAP_I(&btree->bt_bmap)->vfs_inode.i_ino);
+               return;
+       }
+
        list_for_each(head, &lists[level]) {
                cbh = list_entry(head, struct buffer_head, b_assoc_buffers);
                cnode = (struct nilfs_btree_node *)cbh->b_data;
-- 
1.6.6.2

Reply via email to