svn commit: r252337 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

Gavin Atkinson gavin at FreeBSD.org
Fri Jun 28 07:51:12 UTC 2013


Author: gavin
Date: Fri Jun 28 07:51:12 2013
New Revision: 252337
URL: http://svnweb.freebsd.org/changeset/base/252337

Log:
  Don't try to re-insert an already present but invalid page.
  
  This could happen if a thread doing a page-in loses a ZFS range lock
  race to a thread writing to the same range
  
  This fixes "panic: vm_page_alloc: pindex already allocated" in
  http://docs.FreeBSD.org/cgi/mid.cgi?1372165971.96049.42.camel
  
  Submitted by:	avg
  MFC after:	1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Fri Jun 28 06:25:04 2013	(r252336)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Fri Jun 28 07:51:12 2013	(r252337)
@@ -345,10 +345,13 @@ page_busy(vnode_t *vp, int64_t start, in
 				vm_page_sleep(pp, "zfsmwb");
 				continue;
 			}
-		} else {
+		} else if (pp == NULL) {
 			pp = vm_page_alloc(obj, OFF_TO_IDX(start),
 			    VM_ALLOC_SYSTEM | VM_ALLOC_IFCACHED |
 			    VM_ALLOC_NOBUSY);
+		} else {
+			ASSERT(pp != NULL && !pp->valid);
+			pp = NULL;
 		}
 
 		if (pp != NULL) {


More information about the svn-src-all mailing list