kernel - Properly dispose of vm_page_t in sf_buf_mfree()
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 22 Dec 2011 19:43:26 +0000 (11:43 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Thu, 22 Dec 2011 19:43:26 +0000 (11:43 -0800)
* Properly dispose of vm_page_t in sf_buf_mfree(), used by sendfile()

* Should fix a VM page delete/free panic.

Reported-by: sephe
sys/kern/uipc_syscalls.c

index bcbedfa..baeb7b1 100644 (file)
@@ -1413,8 +1413,11 @@ sf_buf_mfree(void *arg)
                vm_page_busy_wait(m, FALSE, "sockpgf");
                vm_page_unwire(m, 0);
                vm_page_wakeup(m);
-               if (m->wire_count == 0 && m->object == NULL)
-                       vm_page_try_to_free(m);
+               if (m->wire_count == 0 && m->object == NULL) {
+                       vm_page_free(m);
+               } else {
+                       vm_page_wakeup(m);
+               }
        }
 }