svn commit: r231190 - stable/7/sys/vm

Alexander Motin mav at
Wed Feb 8 07:34:03 UTC 2012

Author: mav
Date: Wed Feb  8 07:34:03 2012
New Revision: 231190

  MFC 230877:
  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.

Directory Properties:
  stable/7/sys/   (props changed)

Modified: stable/7/sys/vm/swap_pager.c
--- stable/7/sys/vm/swap_pager.c	Wed Feb  8 07:31:55 2012	(r231189)
+++ stable/7/sys/vm/swap_pager.c	Wed Feb  8 07:34:03 2012	(r231190)
@@ -2368,7 +2368,7 @@ swapgeom_orphan(struct g_consumer *cp)
 	TAILQ_FOREACH(sp, &swtailq, sw_list)
 		if (sp->sw_id == cp)
-			sp->sw_id = NULL;
+			sp->sw_flags |= SW_CLOSING;

More information about the svn-src-stable-7 mailing list