]> Zhao Yanbai Git Server - kernel.git/commitdiff
修复遍历page hash死循环的问题
authoracevest <zhaoyanbai@126.com>
Fri, 11 Oct 2024 14:16:32 +0000 (22:16 +0800)
committeracevest <zhaoyanbai@126.com>
Fri, 11 Oct 2024 14:16:32 +0000 (22:16 +0800)
fs/file.c

index a034ac765dbc95e405a34b53efebc6eafc0332c6..dd032062123ff036ea00863528e1a91b77a1141d 100644 (file)
--- 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);