From owner-svn-src-all@FreeBSD.ORG Thu May 5 14:19:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18CEA106566C; Thu, 5 May 2011 14:19:38 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 032A08FC14; Thu, 5 May 2011 14:19:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p45EJbiC003182; Thu, 5 May 2011 14:19:37 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p45EJbFR003180; Thu, 5 May 2011 14:19:37 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105051419.p45EJbFR003180@svn.freebsd.org> From: Rick Macklem Date: Thu, 5 May 2011 14:19:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221498 - stable/8/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Thu, 05 May 2011 14:19:38 -0000 Author: rmacklem Date: Thu May 5 14:19:37 2011 New Revision: 221498 URL: http://svn.freebsd.org/changeset/base/221498 Log: MFC: r220928 Remove the nm_mtx mutex locking from the test for nm_maxfilesize. This value rarely, if ever, changes and the nm_mtx mutex is locked/unlocked earlier in the function, which should be sufficient to avoid getting a stale cached value for it. There is a discussion w.r.t. what these tests should be, but I've left them basically the same as the regular NFS client for now. Modified: stable/8/sys/fs/nfsclient/nfs_clbio.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clbio.c Thu May 5 14:16:40 2011 (r221497) +++ stable/8/sys/fs/nfsclient/nfs_clbio.c Thu May 5 14:19:37 2011 (r221498) @@ -943,12 +943,8 @@ flush_and_restart: if (uio->uio_offset < 0) return (EINVAL); tmp_off = uio->uio_offset + uio->uio_resid; - mtx_lock(&nmp->nm_mtx); - if (tmp_off > nmp->nm_maxfilesize || tmp_off < uio->uio_offset) { - mtx_unlock(&nmp->nm_mtx); + if (tmp_off > nmp->nm_maxfilesize || tmp_off < uio->uio_offset) return (EFBIG); - } - mtx_unlock(&nmp->nm_mtx); if (uio->uio_resid == 0) return (0);