From owner-svn-src-stable-9@freebsd.org Fri May 6 23:55:29 2016 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8C90B31354; Fri, 6 May 2016 23:55:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B64D1455; Fri, 6 May 2016 23:55:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u46NtSn0061499; Fri, 6 May 2016 23:55:28 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u46NtSZ0061497; Fri, 6 May 2016 23:55:28 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201605062355.u46NtSZ0061497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 6 May 2016 23:55:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r299207 - in stable/9/sys/fs: nfs nfsclient X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2016 23:55:29 -0000 Author: rmacklem Date: Fri May 6 23:55:28 2016 New Revision: 299207 URL: https://svnweb.freebsd.org/changeset/base/299207 Log: MFC: r297837 Bruce Evans reported that there was a performance regression between the old and new NFS clients. He did a good job of isolating the problem which was caused by the new NFS client not setting the post write mtime correctly. The new NFS client code was cloned from the old client, but was incorrect, because the mtime in the nfs vnode's cache wasn't yet updated. This patch fixes this problem. The patch also adds missing mutex locking. Modified: stable/9/sys/fs/nfs/nfsport.h stable/9/sys/fs/nfsclient/nfs_clrpcops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfs/nfsport.h ============================================================================== --- stable/9/sys/fs/nfs/nfsport.h Fri May 6 23:49:10 2016 (r299206) +++ stable/9/sys/fs/nfs/nfsport.h Fri May 6 23:55:28 2016 (r299207) @@ -706,12 +706,14 @@ MALLOC_DECLARE(M_NEWNFSDROLLBACK); /* * Set the n_time in the client write rpc, as required. */ -#define NFSWRITERPC_SETTIME(w, n, v4) \ +#define NFSWRITERPC_SETTIME(w, n, a, v4) \ do { \ if (w) { \ - (n)->n_mtime = (n)->n_vattr.na_vattr.va_mtime; \ + mtx_lock(&((n)->n_mtx)); \ + (n)->n_mtime = (a)->na_mtime; \ if (v4) \ - (n)->n_change = (n)->n_vattr.na_vattr.va_filerev; \ + (n)->n_change = (a)->na_filerev; \ + mtx_unlock(&((n)->n_mtx)); \ } \ } while (0) Modified: stable/9/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clrpcops.c Fri May 6 23:49:10 2016 (r299206) +++ stable/9/sys/fs/nfsclient/nfs_clrpcops.c Fri May 6 23:55:28 2016 (r299207) @@ -1618,7 +1618,7 @@ nfsrpc_writerpc(vnode_t vp, struct uio * } if (error) goto nfsmout; - NFSWRITERPC_SETTIME(wccflag, np, (nd->nd_flag & ND_NFSV4)); + NFSWRITERPC_SETTIME(wccflag, np, nap, (nd->nd_flag & ND_NFSV4)); mbuf_freem(nd->nd_mrep); nd->nd_mrep = NULL; tsiz -= len;