From owner-svn-src-projects@FreeBSD.ORG Mon Apr 23 23:51:08 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC620106564A; Mon, 23 Apr 2012 23:51:08 +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 A881F8FC14; Mon, 23 Apr 2012 23:51:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3NNp85Y021005; Mon, 23 Apr 2012 23:51:08 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3NNp8g3021003; Mon, 23 Apr 2012 23:51:08 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201204232351.q3NNp8g3021003@svn.freebsd.org> From: Rick Macklem Date: Mon, 23 Apr 2012 23:51:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234624 - projects/nfsv4.1-client/sys/fs/nfsclient X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 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, 23 Apr 2012 23:51:08 -0000 Author: rmacklem Date: Mon Apr 23 23:51:08 2012 New Revision: 234624 URL: http://svn.freebsd.org/changeset/base/234624 Log: For NFSv4.1, send the seqid field in the open, lock and delegation stateids to the server as 0, so it won't check for NFS4ERR_OLDSTATEID and just use the up to date state. Modified: projects/nfsv4.1-client/sys/fs/nfsclient/nfs_clrpcops.c Modified: projects/nfsv4.1-client/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- projects/nfsv4.1-client/sys/fs/nfsclient/nfs_clrpcops.c Mon Apr 23 23:05:14 2012 (r234623) +++ projects/nfsv4.1-client/sys/fs/nfsclient/nfs_clrpcops.c Mon Apr 23 23:51:08 2012 (r234624) @@ -410,7 +410,10 @@ nfsrpc_openrpc(struct nfsmount *nmp, vno if (dp != NULL) { *tl = txdr_unsigned(NFSV4OPEN_CLAIMDELEGATECUR); NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID); - *tl++ = dp->nfsdl_stateid.seqid; + if (NFSHASNFSV4N(nmp)) + *tl++ = 0; + else + *tl++ = dp->nfsdl_stateid.seqid; *tl++ = dp->nfsdl_stateid.other[0]; *tl++ = dp->nfsdl_stateid.other[1]; *tl = dp->nfsdl_stateid.other[2]; @@ -581,7 +584,10 @@ nfsrpc_opendowngrade(vnode_t vp, u_int32 NFSCL_REQSTART(nd, NFSPROC_OPENDOWNGRADE, vp); NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID + 3 * NFSX_UNSIGNED); - *tl++ = op->nfso_stateid.seqid; + if (NFSHASNFSV4N(VFSTONFS(vnode_mount(vp)))) + *tl++ = 0; + else + *tl++ = op->nfso_stateid.seqid; *tl++ = op->nfso_stateid.other[0]; *tl++ = op->nfso_stateid.other[1]; *tl++ = op->nfso_stateid.other[2]; @@ -742,7 +748,10 @@ nfsrpc_closerpc(struct nfsrv_descript *n op->nfso_fhlen, NULL, NULL); NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED + NFSX_STATEID); *tl++ = txdr_unsigned(op->nfso_own->nfsow_seqid); - *tl++ = op->nfso_stateid.seqid; + if (NFSHASNFSV4N(nmp)) + *tl++ = 0; + else + *tl++ = op->nfso_stateid.seqid; *tl++ = op->nfso_stateid.other[0]; *tl++ = op->nfso_stateid.other[1]; *tl = op->nfso_stateid.other[2]; @@ -2165,7 +2174,10 @@ tryagain: NFSCL_REQSTART(nd, NFSPROC_RETDELEGREMOVE, vp); NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID + NFSX_UNSIGNED); - *tl++ = dstateid.seqid; + if (NFSHASNFSV4N(nmp)) + *tl++ = 0; + else + *tl++ = dstateid.seqid; *tl++ = dstateid.other[0]; *tl++ = dstateid.other[1]; *tl++ = dstateid.other[2]; @@ -2248,7 +2260,10 @@ tryagain: } if (gotfd) { NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID); - *tl++ = fdstateid.seqid; + if (NFSHASNFSV4N(nmp)) + *tl++ = 0; + else + *tl++ = fdstateid.seqid; *tl++ = fdstateid.other[0]; *tl++ = fdstateid.other[1]; *tl = fdstateid.other[2]; @@ -2264,7 +2279,10 @@ tryagain: } if (gottd) { NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID); - *tl++ = tdstateid.seqid; + if (NFSHASNFSV4N(nmp)) + *tl++ = 0; + else + *tl++ = tdstateid.seqid; *tl++ = tdstateid.other[0]; *tl++ = tdstateid.other[1]; *tl = tdstateid.other[2]; @@ -3833,7 +3851,10 @@ nfsrpc_locku(struct nfsrv_descript *nd, (arc4random() % nfstest_outofseq) == 0) *tl = txdr_unsigned(lp->nfsl_seqid + 1); tl++; - *tl++ = lp->nfsl_stateid.seqid; + if (NFSHASNFSV4N(nmp)) + *tl++ = 0; + else + *tl++ = lp->nfsl_stateid.seqid; *tl++ = lp->nfsl_stateid.other[0]; *tl++ = lp->nfsl_stateid.other[1]; *tl++ = lp->nfsl_stateid.other[2]; @@ -3890,7 +3911,10 @@ nfsrpc_lock(struct nfsrv_descript *nd, s NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID + 2 * NFSX_UNSIGNED + NFSX_HYPER); *tl++ = txdr_unsigned(lp->nfsl_open->nfso_own->nfsow_seqid); - *tl++ = lp->nfsl_open->nfso_stateid.seqid; + if (NFSHASNFSV4N(nmp)) + *tl++ = 0; + else + *tl++ = lp->nfsl_open->nfso_stateid.seqid; *tl++ = lp->nfsl_open->nfso_stateid.other[0]; *tl++ = lp->nfsl_open->nfso_stateid.other[1]; *tl++ = lp->nfsl_open->nfso_stateid.other[2]; @@ -3903,7 +3927,10 @@ nfsrpc_lock(struct nfsrv_descript *nd, s } else { *tl = newnfs_false; NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID + NFSX_UNSIGNED); - *tl++ = lp->nfsl_stateid.seqid; + if (NFSHASNFSV4N(nmp)) + *tl++ = 0; + else + *tl++ = lp->nfsl_stateid.seqid; *tl++ = lp->nfsl_stateid.other[0]; *tl++ = lp->nfsl_stateid.other[1]; *tl++ = lp->nfsl_stateid.other[2]; @@ -4275,7 +4302,10 @@ nfsrpc_delegreturn(struct nfscldeleg *dp nfscl_reqstart(nd, NFSPROC_DELEGRETURN, nmp, dp->nfsdl_fh, dp->nfsdl_fhlen, NULL, NULL); NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID); - *tl++ = dp->nfsdl_stateid.seqid; + if (NFSHASNFSV4N(nmp)) + *tl++ = 0; + else + *tl++ = dp->nfsdl_stateid.seqid; *tl++ = dp->nfsdl_stateid.other[0]; *tl++ = dp->nfsdl_stateid.other[1]; *tl = dp->nfsdl_stateid.other[2];