From owner-svn-src-all@FreeBSD.ORG Thu Apr 21 19:56:07 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 4053E1065670; Thu, 21 Apr 2011 19:56:07 +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 2F6EA8FC16; Thu, 21 Apr 2011 19:56:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p3LJu7MO010266; Thu, 21 Apr 2011 19:56:07 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p3LJu7AB010264; Thu, 21 Apr 2011 19:56:07 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201104211956.p3LJu7AB010264@svn.freebsd.org> From: Rick Macklem Date: Thu, 21 Apr 2011 19:56:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220928 - head/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, 21 Apr 2011 19:56:07 -0000 Author: rmacklem Date: Thu Apr 21 19:56:06 2011 New Revision: 220928 URL: http://svn.freebsd.org/changeset/base/220928 Log: 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. Suggested by: pjd MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clbio.c Modified: head/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clbio.c Thu Apr 21 16:40:34 2011 (r220927) +++ head/sys/fs/nfsclient/nfs_clbio.c Thu Apr 21 19:56:06 2011 (r220928) @@ -946,12 +946,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);