]> Zhao Yanbai Git Server - kernel.git/commitdiff
fix bug in put_paging
authorAceVest <zhaoyanbai@126.com>
Mon, 28 Jul 2014 15:24:03 +0000 (23:24 +0800)
committerAceVest <zhaoyanbai@126.com>
Mon, 28 Jul 2014 15:24:03 +0000 (23:24 +0800)
kernel/fork.c

index ee74d85fdf49f657ad9c8080a7d8aac524c71120..a6d2eb5064ac8d8f92d64a38c4b819ff5fba5763 100644 (file)
@@ -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("----");
+                }
             }
 
         }