From owner-svn-src-head@FreeBSD.ORG Fri Jun 28 07:51:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AA201C11; Fri, 28 Jun 2013 07:51:12 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9A59A1A0B; Fri, 28 Jun 2013 07:51:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5S7pCGG068657; Fri, 28 Jun 2013 07:51:12 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5S7pCr2068656; Fri, 28 Jun 2013 07:51:12 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201306280751.r5S7pCr2068656@svn.freebsd.org> From: Gavin Atkinson Date: Fri, 28 Jun 2013 07:51:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252337 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2013 07:51:12 -0000 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) {