From: acevest Date: Fri, 11 Oct 2024 14:16:32 +0000 (+0800) Subject: 修复遍历page hash死循环的问题 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zlib_tech.html?a=commitdiff_plain;h=42bee3a8aa42461134280dffb15a6ea3bd34f280;p=kernel.git 修复遍历page hash死循环的问题 --- diff --git a/fs/file.c b/fs/file.c index a034ac7..dd03206 100644 --- a/fs/file.c +++ b/fs/file.c @@ -52,13 +52,14 @@ page_t *find_hash_page(address_space_t *mapping, uint32_t index) { page_t *p = page_hash_table[hash]; while (p != NULL) { - if (p->mapping != mapping) { - continue; - } - if (p->index == index) { - page = p; - break; + if (p->mapping == mapping) { + if (p->index == index) { + page = p; + break; + } } + + p = p->hash_next; } EXIT_CRITICAL_ZONE(EFLAGS);