From owner-svn-src-projects@freebsd.org Mon May 1 00:57:17 2017 Return-Path: Delivered-To: svn-src-projects@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 43EF9D45F49 for ; Mon, 1 May 2017 00:57:17 +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 15F56E41; Mon, 1 May 2017 00:57:17 +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 v410vGsZ062059; Mon, 1 May 2017 00:57:16 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v410vGSq062058; Mon, 1 May 2017 00:57:16 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201705010057.v410vGSq062058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 1 May 2017 00:57:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r317615 - projects/pnfs-planb-server/sys/fs/nfsserver X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 00:57:17 -0000 Author: rmacklem Date: Mon May 1 00:57:15 2017 New Revision: 317615 URL: https://svnweb.freebsd.org/changeset/base/317615 Log: Update file attributes upon Close, since the Linux client doesn't always do a LayoutCommit operation. There are still cases where the Linux client does a Getattr without first doing Close or LayoutCommit. The case I've observed is just before a Lock operation on the file. At this point, all you can do to get this case to work correctly is set the sysctl vfs.nfsd.pnfsgetdsattr=1. Modified: projects/pnfs-planb-server/sys/fs/nfsserver/nfs_nfsdserv.c Modified: projects/pnfs-planb-server/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- projects/pnfs-planb-server/sys/fs/nfsserver/nfs_nfsdserv.c Mon May 1 00:53:07 2017 (r317614) +++ projects/pnfs-planb-server/sys/fs/nfsserver/nfs_nfsdserv.c Mon May 1 00:57:15 2017 (r317615) @@ -3142,6 +3142,7 @@ nfsrvd_close(struct nfsrv_descript *nd, int error = 0; nfsv4stateid_t stateid; nfsquad_t clientid; + struct nfsvattr na; NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED + NFSX_STATEID); stp->ls_seq = fxdr_unsigned(u_int32_t, *tl++); @@ -3182,6 +3183,8 @@ nfsrvd_close(struct nfsrv_descript *nd, nd->nd_clientid.qval = clientid.qval; } nd->nd_repstat = nfsrv_openupdate(vp, stp, clientid, &stateid, nd, p); + /* For pNFS, update the attributes. */ + nfsrv_updatemdsattr(vp, &na, p); vput(vp); if (!nd->nd_repstat) { /*