From: AceVest Date: Mon, 28 Jul 2014 15:24:03 +0000 (+0800) Subject: fix bug in put_paging X-Git-Tag: 0.3.0~10 X-Git-Url: http://zhaoyanbai.com/repos/?a=commitdiff_plain;h=fe58ed58ff3ba03e7e57b96e5a0b67a80d56079b;p=kernel.git fix bug in put_paging --- diff --git a/kernel/fork.c b/kernel/fork.c index ee74d85..a6d2eb5 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -78,8 +78,17 @@ int do_fork(pt_regs_t *regs, unsigned long flags) pte_src[j] &= ~PAGE_WR; pte_dst[j] = pte_src[j]; + if(pte_src[j] == 0) + continue; + printk("----pde[%u] pte_src[%u] %08x\n", i, j, pte_src[j]); page_t *page = pa2page(pte_src[j]); page->count ++; + //assert(page->count <= 1); + if(page->count > 1) + { + printk("page %08x count %d\n", page, page->count); + panic("----"); + } } }