From owner-svn-src-all@FreeBSD.ORG Wed Mar 19 19:33:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1A4DD81F; Wed, 19 Mar 2014 19:33:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 06CDA2BC; Wed, 19 Mar 2014 19:33:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2JJXtdq000556; Wed, 19 Mar 2014 19:33:55 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JJXtht000555; Wed, 19 Mar 2014 19:33:55 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403191933.s2JJXtht000555@svn.freebsd.org> From: Xin LI Date: Wed, 19 Mar 2014 19:33:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r263376 - stable/8/sys/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 19:33:56 -0000 Author: delphij Date: Wed Mar 19 19:33:55 2014 New Revision: 263376 URL: http://svnweb.freebsd.org/changeset/base/263376 Log: Make it possible to call VOP_PUTPAGES with shared vnode lock instead of insisting an exclusive lock. When VFS_LOCK_DEBUG is enabled and when the underlying file system is capable of MNT_SHARED_WRITES, a failed assertion may lead to a panic because when calling fsync(2), a.k.a. sys_fsync() over a vnode with mmap'ed page, it will grab a shared lock when underlying file system is capable, then call vm_object_page_clean that eventually proceeded to vnode_pager_putpages() that tries to do VOP_PUTPAGES, where VOP_PUTPAGES_APV generated from the declaration asserts the vnode is always exclusively locked by caller. This is a direct commit to stable/8 because a majority portion of the original changeset 257899 (kib), which main goal was an optimization, was omitted. We saw the panic independently in a FreeNAS bug ticket (#4578). Modified: stable/8/sys/kern/vnode_if.src Modified: stable/8/sys/kern/vnode_if.src ============================================================================== --- stable/8/sys/kern/vnode_if.src Wed Mar 19 19:32:53 2014 (r263375) +++ stable/8/sys/kern/vnode_if.src Wed Mar 19 19:33:55 2014 (r263376) @@ -470,7 +470,7 @@ vop_getpages { }; -%% putpages vp E E E +%% putpages vp L L L vop_putpages { IN struct vnode *vp;