From owner-svn-src-head@FreeBSD.ORG Fri May 22 15:01:48 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 1EE9E10656C2; Fri, 22 May 2009 15:01:48 +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 0DBE08FC13; Fri, 22 May 2009 15:01:48 +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 n4MF1l2E009863; Fri, 22 May 2009 15:01:47 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4MF1lCf009862; Fri, 22 May 2009 15:01:47 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200905221501.n4MF1lCf009862@svn.freebsd.org> From: Rick Macklem Date: Fri, 22 May 2009 15:01:47 +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: r192582 - 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: Fri, 22 May 2009 15:01:48 -0000 Author: rmacklem Date: Fri May 22 15:01:47 2009 New Revision: 192582 URL: http://svn.freebsd.org/changeset/base/192582 Log: Change the code in the experimental nfs client to avoid flushing writes upon close when a write delegation is held by the client. This should be safe to do, now that nfsv4 Close operations are delayed until ncl_inactive() is called for the vnode. Approved by: 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 Fri May 22 14:53:26 2009 (r192581) +++ head/sys/fs/nfsclient/nfs_clvnops.c Fri May 22 15:01:47 2009 (r192582) @@ -687,12 +687,8 @@ 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)) { - int cm; - if (newnfs_commit_on_close != 0) - cm = 1; - else - cm = nfscl_mustflush(vp); + } 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; */