Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 May 2011 01:38:42 +0000 (UTC)
From:      Max Laier <mlaier@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r221796 - stable/7/sys/vm
Message-ID:  <201105120138.p4C1cgU4014264@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mlaier
Date: Thu May 12 01:38:42 2011
New Revision: 221796
URL: http://svn.freebsd.org/changeset/base/221796

Log:
  MFH r221714:
   Another long standing vm bug found at Isilon:
    Fix a race between vm_object_collapse and vm_fault.
  
   Reviewed by:	alc@

Modified:
  stable/7/sys/vm/vm_object.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/vm/vm_object.c
==============================================================================
--- stable/7/sys/vm/vm_object.c	Thu May 12 01:22:23 2011	(r221795)
+++ stable/7/sys/vm/vm_object.c	Thu May 12 01:38:42 2011	(r221796)
@@ -1613,6 +1613,24 @@ vm_object_backing_scan(vm_object_t objec
 
 			pp = vm_page_lookup(object, new_pindex);
 			if (
+			    (op & OBSC_COLLAPSE_NOWAIT) != 0 &&
+			    (pp != NULL && pp->valid == 0)
+			) {
+				/*
+				 * The page in the parent is not (yet) valid.
+				 * We don't know anything about the state of
+				 * the original page.  It might be mapped,
+				 * so we must avoid the next if here.
+				 *
+				 * This is due to a race in vm_fault() where
+				 * we must unbusy the original (backing_obj)
+				 * page before we can (re)lock the parent.
+				 * Hence we can get here.
+				 */
+				p = next;
+				continue;
+			}
+			if (
 			    pp != NULL ||
 			    vm_pager_has_page(object, new_pindex, NULL, NULL)
 			) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105120138.p4C1cgU4014264>