From owner-svn-src-head@FreeBSD.ORG Wed Jul 29 14:50:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E21941065670; Wed, 29 Jul 2009 14:50:31 +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 CFE998FC16; Wed, 29 Jul 2009 14:50:31 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6TEoV0r074392; Wed, 29 Jul 2009 14:50:31 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6TEoVK7074390; Wed, 29 Jul 2009 14:50:31 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200907291450.n6TEoVK7074390@svn.freebsd.org> From: Rick Macklem Date: Wed, 29 Jul 2009 14:50:31 +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: r195943 - head/sys/fs/nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 29 Jul 2009 14:50:32 -0000 Author: rmacklem Date: Wed Jul 29 14:50:31 2009 New Revision: 195943 URL: http://svn.freebsd.org/changeset/base/195943 Log: Fix the experimental nfs client so that it only calls ncl_vinvalbuf() for NFSv2 and not NFSv4 when nfscl_mustflush() returns 0. Since nfscl_mustflush() only returns 0 when there is a valid write delegation issued to the client, it only affects the case of an NFSv4 mount with callbacks/delegations enabled. Approved by: re (kensmith), kib (mentor) Modified: head/sys/fs/nfsclient/nfs_clvnops.c Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Wed Jul 29 14:44:09 2009 (r195942) +++ head/sys/fs/nfsclient/nfs_clvnops.c Wed Jul 29 14:50:31 2009 (r195943) @@ -687,11 +687,17 @@ nfs_close(struct vop_close_args *ap) int cm = newnfs_commit_on_close ? 1 : 0; error = ncl_flush(vp, MNT_WAIT, cred, ap->a_td, cm); /* np->n_flag &= ~NMODIFIED; */ - } else if (NFS_ISV4(vp) && nfscl_mustflush(vp)) { - int cm = newnfs_commit_on_close ? 1 : 0; - error = ncl_flush(vp, MNT_WAIT, cred, ap->a_td, cm); - /* as above w.r.t. races when clearing NMODIFIED */ - /* np->n_flag &= ~NMODIFIED; */ + } else if (NFS_ISV4(vp)) { + if (nfscl_mustflush(vp)) { + int cm = newnfs_commit_on_close ? 1 : 0; + error = ncl_flush(vp, MNT_WAIT, cred, ap->a_td, + cm); + /* + * as above w.r.t races when clearing + * NMODIFIED. + * np->n_flag &= ~NMODIFIED; + */ + } } else error = ncl_vinvalbuf(vp, V_SAVE, ap->a_td, 1); mtx_lock(&np->n_mtx);