From: AceVest Date: Mon, 28 Jul 2014 15:24:03 +0000 (+0800) Subject: fix bug in put_paging X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zlib_tech.html?a=commitdiff_plain;h=c8746ff216cf1340e3bf825b6a95e8f97e5793b1;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("----"); + } } }