summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2012-02-01 20:12:44 +0000
committermav <mav@FreeBSD.org>2012-02-01 20:12:44 +0000
commit3cc9e27b24b283ffb0509211ea58e3f7bd1fa1de (patch)
treeec97b3bff9364b63b351ed2ae71276b3950c952c /sys/vm
parenta46b1b7ab382fc815708b9ba049ef342bdad65bc (diff)
downloadFreeBSD-src-3cc9e27b24b283ffb0509211ea58e3f7bd1fa1de.zip
FreeBSD-src-3cc9e27b24b283ffb0509211ea58e3f7bd1fa1de.tar.gz
Fix NULL dereference panic on attempt to turn off (on system shutdown)
disconnected swap device. This is quick and imperfect solution, as swap device will still be opened and GEOM will not be able to destroy it. Proper solution would be to automatically turn off and close disconnected swap device, but with existing code it will cause panic if there is at least one page on device, even if it is unimportant page of the user-level process. It needs some work. Reviewed by: kib@ MFC after: 1 week
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/swap_pager.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index dba624b..93621a9 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -2521,7 +2521,7 @@ swapgeom_orphan(struct g_consumer *cp)
mtx_lock(&sw_dev_mtx);
TAILQ_FOREACH(sp, &swtailq, sw_list)
if (sp->sw_id == cp)
- sp->sw_id = NULL;
+ sp->sw_flags |= SW_CLOSING;
mtx_unlock(&sw_dev_mtx);
}
OpenPOWER on IntegriCloud