From nobody Sun Jul 24 19:51:09 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4LrYhF4HRSz4XPQP; Sun, 24 Jul 2022 19:51:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LrYhF43zfz3ZlZ; Sun, 24 Jul 2022 19:51:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658692269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j50r1ATW0fZrEvxrPs9NwvNwdQkFfafuvp9OIbROovk=; b=iJ54LjsM0aVDfBqMhw4cIqp/GY0JR3Bw2HvdHUPd0oUidCxEKin5Jyx2s8NyKwjtc8j9zy BxSJKEIt3DoCGB0mlffX8RY69xWpI/fNTzmTmkNez0frj32b1XmodYqW8Pki99EyAB8Kr5 G6brTvIVnw9j4ULUWOEKp8JkDahWfqGCID39B6DWtPUo98VGCYl6yC/W2uqM2mw54vZ2pC Oakf/HKsGK8lNiI9vINeXNIY1UM6/W2YsfMiB0V/4G2A2+9tmAFooh0NRjYueZ+sTxsWya 6GFd4TXKrTC22FWGOqhuuw6Lq3mY3FW/NH6iMM7DKlAu6GgXKmRaZVDueRFrIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4LrYhF359xzWNP; Sun, 24 Jul 2022 19:51:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 26OJp9xA055054; Sun, 24 Jul 2022 19:51:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26OJp9p7055053; Sun, 24 Jul 2022 19:51:09 GMT (envelope-from git) Date: Sun, 24 Jul 2022 19:51:09 GMT Message-Id: <202207241951.26OJp9p7055053@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: d0ab875c5f66 - stable/13 - nfscl: Add a cred argument to nfscl_reqstart() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d0ab875c5f663d0beaa262bf3349d4d2238f505a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658692269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j50r1ATW0fZrEvxrPs9NwvNwdQkFfafuvp9OIbROovk=; b=PRAj8x2ZRCFX1/HDqYXkOyQPBUycHMFrsgZ5YFrSl2GS+OFoQW8tQyZptM7LlRNgb15Xem 0+z07a3aNSt36BtXT2JP8D1jrrnH0PJ4FuN3lJRnVPk/txxC60h+Pvc9WoXeGPQEZZO526 LI+AvTOATalduQPf2sgU7NMAkUr25KxHOCu5oo1aSc/X/mf+x3lpVeQjhY91fXQulQsEje Nkjcl1P1J/945t4gb3ZXil2DL3GMTP6zVZeIU7J55Ee3S8X5SCYn8Mfk76XrblxOgjLa1V xxI9Kf5ckzLX9nKwQc8NB4nPUGtrLmr7W30w9kJf7tNGnXqytpNipr9ZN8rhAw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658692269; a=rsa-sha256; cv=none; b=nlDtGG2Qu9qNOr47uSFWZH9L1Hmb0QfmYVLj+oAFaP6dDwxy7HlKyQ41csxXuPq+IzC4oe Q04hKWQf+TyFe5u2UlCMLkMk/utuoDVrO/XPY9uxxaaSoDK0eD9f5XRkF8PYqWcSqLWqe6 /kW8SFBBBZZ4ts9TMeFjJTtYgjFSpdAPxs0d7YSSZxPfOrn2WRVAV7fXmp5kFUDBGKzvoe 0JJQV0CF0nImLdAQhcxG0ovGX3oaUaGu6wwxjMYFmWdlpNmXDmJncUfryFwg78obQCBWVw gz5GbgVzDE01IsGWQy/BcOYJIzO3u/eJqwNgq54wQ9actkBYAcw18f7CT+2tjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=d0ab875c5f663d0beaa262bf3349d4d2238f505a commit d0ab875c5f663d0beaa262bf3349d4d2238f505a Author: Rick Macklem AuthorDate: 2022-07-08 23:58:06 +0000 Commit: Rick Macklem CommitDate: 2022-07-24 19:41:57 +0000 nfscl: Add a cred argument to nfscl_reqstart() To deal with broken session slots caused by the use of the "soft" and/or "intr" mount options, nfsv4_sequencelookup() will be modified to track the potentially broken session slots. Then, when all session slots are potentially broken, do a DeleteSession operation, so that the NFSv4 server will reply NFSERR_BADSESSION to uses of the session. These changes will be done in future commits. However, to do the DeleteSession RPC, a "cred" argument is needed for nfscl_reqstart(). This patch adds this argument, which is unused at this time. If the argument is NULL, it indicates that DeleteSession should not be done (usually because the RPC does not use sessions). This patch should not cause any semantics change. PR: 260011 MFC after: 2 weeks (cherry picked from commit 326bcf9394c74ac19afda7c741b3521d91b46b10) --- sys/fs/nfs/nfs_commonsubs.c | 2 +- sys/fs/nfs/nfs_var.h | 3 +- sys/fs/nfs/nfscl.h | 4 +- sys/fs/nfsclient/nfs_clrpcops.c | 174 +++++++++++++++++++++------------------- sys/fs/nfsserver/nfs_nfsdport.c | 14 ++-- 5 files changed, 105 insertions(+), 92 deletions(-) diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index d65c98c6d0a9..8c72f684a06c 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -323,7 +323,7 @@ static int nfs_bigrequest[NFSV42_NPROCS] = { void nfscl_reqstart(struct nfsrv_descript *nd, int procnum, struct nfsmount *nmp, u_int8_t *nfhp, int fhlen, u_int32_t **opcntpp, struct nfsclsession *sep, - int vers, int minorvers) + int vers, int minorvers, __unused struct ucred *cred) { struct mbuf *mb; u_int32_t *tl; diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index 69bba223b4b5..b493ee509440 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -315,7 +315,8 @@ void nfsrc_trimcache(uint64_t, uint32_t, int); /* nfs_commonsubs.c */ void nfscl_reqstart(struct nfsrv_descript *, int, struct nfsmount *, - u_int8_t *, int, u_int32_t **, struct nfsclsession *, int, int); + u_int8_t *, int, u_int32_t **, struct nfsclsession *, int, int, + struct ucred *); void nfsm_stateidtom(struct nfsrv_descript *, nfsv4stateid_t *, int); void nfscl_fillsattr(struct nfsrv_descript *, struct vattr *, vnode_t, int, u_int32_t); diff --git a/sys/fs/nfs/nfscl.h b/sys/fs/nfs/nfscl.h index 3d7afaf68432..07b5e727461c 100644 --- a/sys/fs/nfs/nfscl.h +++ b/sys/fs/nfs/nfscl.h @@ -49,10 +49,10 @@ struct nfsv4node { /* * Just a macro to convert the nfscl_reqstart arguments. */ -#define NFSCL_REQSTART(n, p, v) \ +#define NFSCL_REQSTART(n, p, v, c) \ nfscl_reqstart((n), (p), VFSTONFS((v)->v_mount), \ VTONFS(v)->n_fhp->nfh_fh, VTONFS(v)->n_fhp->nfh_len, NULL, \ - NULL, 0, 0) + NULL, 0, 0, (c)) /* * These two macros convert between a lease duration and renew interval. diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index fbca55027807..45aa2a8b4d6d 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -239,7 +239,7 @@ nfsrpc_null(vnode_t vp, struct ucred *cred, NFSPROC_T *p) int error; struct nfsrv_descript nfsd, *nd = &nfsd; - NFSCL_REQSTART(nd, NFSPROC_NULL, vp); + NFSCL_REQSTART(nd, NFSPROC_NULL, vp, NULL); error = nfscl_request(nd, vp, p, cred, NULL); if (nd->nd_repstat && !error) error = nd->nd_repstat; @@ -308,7 +308,7 @@ nfsrpc_accessrpc(vnode_t vp, u_int32_t mode, struct ucred *cred, *attrflagp = 0; supported = mode; - NFSCL_REQSTART(nd, NFSPROC_ACCESS, vp); + NFSCL_REQSTART(nd, NFSPROC_ACCESS, vp, cred); NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(mode); if (nd->nd_flag & ND_NFSV4) { @@ -512,7 +512,8 @@ nfsrpc_openrpc(struct nfsmount *nmp, vnode_t vp, u_int8_t *nfhp, int fhlen, dp = *dpp; *dpp = NULL; - nfscl_reqstart(nd, NFSPROC_OPEN, nmp, nfhp, fhlen, NULL, NULL, 0, 0); + nfscl_reqstart(nd, NFSPROC_OPEN, nmp, nfhp, fhlen, NULL, NULL, 0, 0, + cred); NFSM_BUILD(tl, u_int32_t *, 5 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(op->nfso_own->nfsow_seqid); *tl++ = txdr_unsigned(mode & NFSV4OPEN_ACCESSBOTH); @@ -705,7 +706,7 @@ nfsrpc_opendowngrade(vnode_t vp, u_int32_t mode, struct nfsclopen *op, struct nfsrv_descript nfsd, *nd = &nfsd; int error; - NFSCL_REQSTART(nd, NFSPROC_OPENDOWNGRADE, vp); + NFSCL_REQSTART(nd, NFSPROC_OPENDOWNGRADE, vp, cred); NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID + 3 * NFSX_UNSIGNED); if (NFSHASNFSV4N(VFSTONFS(vp->v_mount))) *tl++ = 0; @@ -870,7 +871,7 @@ nfsrpc_closerpc(struct nfsrv_descript *nd, struct nfsmount *nmp, int error; nfscl_reqstart(nd, NFSPROC_CLOSE, nmp, op->nfso_fh, - op->nfso_fhlen, NULL, NULL, 0, 0); + op->nfso_fhlen, NULL, NULL, 0, 0, cred); NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED + NFSX_STATEID); if (NFSHASNFSV4N(nmp)) { *tl++ = 0; @@ -916,7 +917,7 @@ nfsrpc_openconfirm(vnode_t vp, u_int8_t *nfhp, int fhlen, if (NFSHASNFSV4N(nmp)) return (0); /* No confirmation for NFSv4.1. */ nfscl_reqstart(nd, NFSPROC_OPENCONFIRM, nmp, nfhp, fhlen, NULL, NULL, - 0, 0); + 0, 0, NULL); NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED + NFSX_STATEID); *tl++ = op->nfso_stateid.seqid; *tl++ = op->nfso_stateid.other[0]; @@ -1109,7 +1110,8 @@ nfsrpc_setclient(struct nfsmount *nmp, struct nfsclclient *clp, int reclaim, tsep = NFSMNT_MDSSESSION(nmp); NFSUNLOCKMNT(nmp); - nfscl_reqstart(nd, NFSPROC_SETCLIENTID, nmp, NULL, 0, NULL, NULL, 0, 0); + nfscl_reqstart(nd, NFSPROC_SETCLIENTID, nmp, NULL, 0, NULL, NULL, 0, 0, + NULL); NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(nfsboottime.tv_sec); *tl = txdr_unsigned(clp->nfsc_rev); @@ -1179,7 +1181,7 @@ nfsrpc_setclient(struct nfsmount *nmp, struct nfsclclient *clp, int reclaim, * and confirm it. */ nfscl_reqstart(nd, NFSPROC_SETCLIENTIDCFRM, nmp, NULL, 0, NULL, - NULL, 0, 0); + NULL, 0, 0, NULL); NFSM_BUILD(tl, u_int32_t *, 4 * NFSX_UNSIGNED); *tl++ = tsep->nfsess_clientid.lval[0]; *tl++ = tsep->nfsess_clientid.lval[1]; @@ -1210,7 +1212,7 @@ nfsrpc_getattr(vnode_t vp, struct ucred *cred, NFSPROC_T *p, int error; nfsattrbit_t attrbits; - NFSCL_REQSTART(nd, NFSPROC_GETATTR, vp); + NFSCL_REQSTART(nd, NFSPROC_GETATTR, vp, cred); if (nd->nd_flag & ND_NFSV4) { NFSGETATTR_ATTRBIT(&attrbits); (void) nfsrv_putattrbit(nd, &attrbits); @@ -1238,7 +1240,8 @@ nfsrpc_getattrnovp(struct nfsmount *nmp, u_int8_t *fhp, int fhlen, int syscred, int error, vers = NFS_VER2; nfsattrbit_t attrbits; - nfscl_reqstart(nd, NFSPROC_GETATTR, nmp, fhp, fhlen, NULL, NULL, 0, 0); + nfscl_reqstart(nd, NFSPROC_GETATTR, nmp, fhp, fhlen, NULL, NULL, 0, 0, + cred); if (nd->nd_flag & ND_NFSV4) { vers = NFS_VER4; NFSGETATTR_ATTRBIT(&attrbits); @@ -1364,7 +1367,7 @@ nfsrpc_setattrrpc(vnode_t vp, struct vattr *vap, nfsattrbit_t attrbits; *attrflagp = 0; - NFSCL_REQSTART(nd, NFSPROC_SETATTR, vp); + NFSCL_REQSTART(nd, NFSPROC_SETATTR, vp, cred); if (nd->nd_flag & ND_NFSV4) nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); vap->va_type = vnode_vtype(vp); @@ -1432,9 +1435,9 @@ nfsrpc_lookup(vnode_t dvp, char *name, int len, struct ucred *cred, if (NFSHASNFSV4(nmp) && len == 2 && name[0] == '.' && name[1] == '.') { lookupp = 1; - NFSCL_REQSTART(nd, NFSPROC_LOOKUPP, dvp); + NFSCL_REQSTART(nd, NFSPROC_LOOKUPP, dvp, cred); } else { - NFSCL_REQSTART(nd, NFSPROC_LOOKUP, dvp); + NFSCL_REQSTART(nd, NFSPROC_LOOKUP, dvp, cred); (void) nfsm_strtom(nd, name, len); } if (nd->nd_flag & ND_NFSV4) { @@ -1510,7 +1513,7 @@ nfsrpc_readlink(vnode_t vp, struct uio *uiop, struct ucred *cred, int error, len, cangetattr = 1; *attrflagp = 0; - NFSCL_REQSTART(nd, NFSPROC_READLINK, vp); + NFSCL_REQSTART(nd, NFSPROC_READLINK, vp, cred); if (nd->nd_flag & ND_NFSV4) { /* * And do a Getattr op. @@ -1646,7 +1649,7 @@ nfsrpc_readrpc(vnode_t vp, struct uio *uiop, struct ucred *cred, while (tsiz > 0) { *attrflagp = 0; len = (tsiz > rsize) ? rsize : tsiz; - NFSCL_REQSTART(nd, NFSPROC_READ, vp); + NFSCL_REQSTART(nd, NFSPROC_READ, vp, cred); if (nd->nd_flag & ND_NFSV4) nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED * 3); @@ -1830,9 +1833,9 @@ nfsrpc_writerpc(vnode_t vp, struct uio *uiop, int *iomode, *attrflagp = 0; len = (tsiz > wsize) ? wsize : tsiz; if (do_append) - NFSCL_REQSTART(nd, NFSPROC_APPENDWRITE, vp); + NFSCL_REQSTART(nd, NFSPROC_APPENDWRITE, vp, cred); else - NFSCL_REQSTART(nd, NFSPROC_WRITE, vp); + NFSCL_REQSTART(nd, NFSPROC_WRITE, vp, cred); if (nd->nd_flag & ND_NFSV4) { if (do_append) { NFSZERO_ATTRBIT(&attrbits); @@ -2037,7 +2040,7 @@ nfsrpc_mknod(vnode_t dvp, char *name, int namelen, struct vattr *vap, *dattrflagp = 0; if (namelen > NFS_MAXNAMLEN) return (ENAMETOOLONG); - NFSCL_REQSTART(nd, NFSPROC_MKNOD, dvp); + NFSCL_REQSTART(nd, NFSPROC_MKNOD, dvp, cred); if (nd->nd_flag & ND_NFSV4) { if (vtyp == VBLK || vtyp == VCHR) { NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED); @@ -2187,7 +2190,7 @@ nfsrpc_createv23(vnode_t dvp, char *name, int namelen, struct vattr *vap, *dattrflagp = 0; if (namelen > NFS_MAXNAMLEN) return (ENAMETOOLONG); - NFSCL_REQSTART(nd, NFSPROC_CREATE, dvp); + NFSCL_REQSTART(nd, NFSPROC_CREATE, dvp, cred); (void) nfsm_strtom(nd, name, namelen); if (nd->nd_flag & ND_NFSV3) { NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); @@ -2249,7 +2252,7 @@ nfsrpc_createv4(vnode_t dvp, char *name, int namelen, struct vattr *vap, *dattrflagp = 0; if (namelen > NFS_MAXNAMLEN) return (ENAMETOOLONG); - NFSCL_REQSTART(nd, NFSPROC_CREATE, dvp); + NFSCL_REQSTART(nd, NFSPROC_CREATE, dvp, cred); /* * For V4, this is actually an Open op. */ @@ -2490,7 +2493,7 @@ tryagain: if (NFSHASNFSV4(nmp) && ret == 0) { ret = nfscl_removedeleg(vp, p, &dstateid); if (ret == 1) { - NFSCL_REQSTART(nd, NFSPROC_RETDELEGREMOVE, vp); + NFSCL_REQSTART(nd, NFSPROC_RETDELEGREMOVE, vp, cred); NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID + NFSX_UNSIGNED); if (NFSHASNFSV4N(nmp)) @@ -2511,7 +2514,7 @@ tryagain: ret = 0; } if (ret == 0) - NFSCL_REQSTART(nd, NFSPROC_REMOVE, dvp); + NFSCL_REQSTART(nd, NFSPROC_REMOVE, dvp, cred); (void) nfsm_strtom(nd, name, namelen); error = nfscl_request(nd, dvp, p, cred, dstuff); if (error) @@ -2571,11 +2574,11 @@ tryagain: ret = nfscl_renamedeleg(fvp, &fdstateid, &gotfd, tvp, &tdstateid, &gottd, p); if (gotfd && gottd) { - NFSCL_REQSTART(nd, NFSPROC_RETDELEGRENAME2, fvp); + NFSCL_REQSTART(nd, NFSPROC_RETDELEGRENAME2, fvp, cred); } else if (gotfd) { - NFSCL_REQSTART(nd, NFSPROC_RETDELEGRENAME1, fvp); + NFSCL_REQSTART(nd, NFSPROC_RETDELEGRENAME1, fvp, cred); } else if (gottd) { - NFSCL_REQSTART(nd, NFSPROC_RETDELEGRENAME1, tvp); + NFSCL_REQSTART(nd, NFSPROC_RETDELEGRENAME1, tvp, cred); } if (gotfd) { NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID); @@ -2619,7 +2622,7 @@ tryagain: ret = 0; } if (ret == 0) - NFSCL_REQSTART(nd, NFSPROC_RENAME, fdvp); + NFSCL_REQSTART(nd, NFSPROC_RENAME, fdvp, cred); if (nd->nd_flag & ND_NFSV4) { NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_GETATTR); @@ -2718,7 +2721,7 @@ nfsrpc_link(vnode_t dvp, vnode_t vp, char *name, int namelen, *dattrflagp = 0; if (namelen > NFS_MAXNAMLEN) return (ENAMETOOLONG); - NFSCL_REQSTART(nd, NFSPROC_LINK, vp); + NFSCL_REQSTART(nd, NFSPROC_LINK, vp, cred); if (nd->nd_flag & ND_NFSV4) { NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_PUTFH); @@ -2785,7 +2788,7 @@ nfsrpc_symlink(vnode_t dvp, char *name, int namelen, const char *target, slen = strlen(target); if (slen > NFS_MAXPATHLEN || namelen > NFS_MAXNAMLEN) return (ENAMETOOLONG); - NFSCL_REQSTART(nd, NFSPROC_SYMLINK, dvp); + NFSCL_REQSTART(nd, NFSPROC_SYMLINK, dvp, cred); if (nd->nd_flag & ND_NFSV4) { NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFLNK); @@ -2848,7 +2851,7 @@ nfsrpc_mkdir(vnode_t dvp, char *name, int namelen, struct vattr *vap, fhp = VTONFS(dvp)->n_fhp; if (namelen > NFS_MAXNAMLEN) return (ENAMETOOLONG); - NFSCL_REQSTART(nd, NFSPROC_MKDIR, dvp); + NFSCL_REQSTART(nd, NFSPROC_MKDIR, dvp, cred); if (nd->nd_flag & ND_NFSV4) { NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFDIR); @@ -2920,7 +2923,7 @@ nfsrpc_rmdir(vnode_t dvp, char *name, int namelen, struct ucred *cred, *dattrflagp = 0; if (namelen > NFS_MAXNAMLEN) return (ENAMETOOLONG); - NFSCL_REQSTART(nd, NFSPROC_RMDIR, dvp); + NFSCL_REQSTART(nd, NFSPROC_RMDIR, dvp, cred); (void) nfsm_strtom(nd, name, namelen); error = nfscl_request(nd, dvp, p, cred, dstuff); if (error) @@ -3037,7 +3040,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, * Joy, oh joy. For V4 we get to hand craft '.' and '..'. */ if (uiop->uio_offset == 0) { - NFSCL_REQSTART(nd, NFSPROC_LOOKUPP, vp); + NFSCL_REQSTART(nd, NFSPROC_LOOKUPP, vp, cred); NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(NFSV4OP_GETFH); *tl = txdr_unsigned(NFSV4OP_GETATTR); @@ -3154,7 +3157,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, */ while (more_dirs && bigenough) { *attrflagp = 0; - NFSCL_REQSTART(nd, NFSPROC_READDIR, vp); + NFSCL_REQSTART(nd, NFSPROC_READDIR, vp, cred); if (nd->nd_flag & ND_NFSV2) { NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); *tl++ = cookie.lval[1]; @@ -3481,7 +3484,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, * Joy, oh joy. For V4 we get to hand craft '.' and '..'. */ if (uiop->uio_offset == 0) { - NFSCL_REQSTART(nd, NFSPROC_LOOKUPP, vp); + NFSCL_REQSTART(nd, NFSPROC_LOOKUPP, vp, cred); NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(NFSV4OP_GETFH); *tl = txdr_unsigned(NFSV4OP_GETATTR); @@ -3603,7 +3606,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, */ while (more_dirs && bigenough) { *attrflagp = 0; - NFSCL_REQSTART(nd, NFSPROC_READDIRPLUS, vp); + NFSCL_REQSTART(nd, NFSPROC_READDIRPLUS, vp, cred); NFSM_BUILD(tl, u_int32_t *, 6 * NFSX_UNSIGNED); *tl++ = cookie.lval[0]; *tl++ = cookie.lval[1]; @@ -3959,7 +3962,7 @@ nfsrpc_commit(vnode_t vp, u_quad_t offset, int cnt, struct ucred *cred, struct nfsmount *nmp = VFSTONFS(vp->v_mount); *attrflagp = 0; - NFSCL_REQSTART(nd, NFSPROC_COMMIT, vp); + NFSCL_REQSTART(nd, NFSPROC_COMMIT, vp, cred); NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED); txdr_hyper(offset, tl); tl += 2; @@ -4179,7 +4182,7 @@ nfsrpc_lockt(struct nfsrv_descript *nd, vnode_t vp, struct nfsclsession *tsep; nmp = VFSTONFS(vp->v_mount); - NFSCL_REQSTART(nd, NFSPROC_LOCKT, vp); + NFSCL_REQSTART(nd, NFSPROC_LOCKT, vp, cred); NFSM_BUILD(tl, u_int32_t *, 7 * NFSX_UNSIGNED); if (fl->l_type == F_RDLCK) *tl++ = txdr_unsigned(NFSV4LOCKT_READ); @@ -4250,7 +4253,7 @@ nfsrpc_locku(struct nfsrv_descript *nd, struct nfsmount *nmp, int error; nfscl_reqstart(nd, NFSPROC_LOCKU, nmp, lp->nfsl_open->nfso_fh, - lp->nfsl_open->nfso_fhlen, NULL, NULL, 0, 0); + lp->nfsl_open->nfso_fhlen, NULL, NULL, 0, 0, cred); NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID + 6 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(type); *tl = txdr_unsigned(lp->nfsl_seqid); @@ -4302,7 +4305,8 @@ nfsrpc_lock(struct nfsrv_descript *nd, struct nfsmount *nmp, vnode_t vp, uint8_t own[NFSV4CL_LOCKNAMELEN + NFSX_V4FHMAX]; struct nfsclsession *tsep; - nfscl_reqstart(nd, NFSPROC_LOCK, nmp, nfhp, fhlen, NULL, NULL, 0, 0); + nfscl_reqstart(nd, NFSPROC_LOCK, nmp, nfhp, fhlen, NULL, NULL, 0, 0, + cred); NFSM_BUILD(tl, u_int32_t *, 7 * NFSX_UNSIGNED); if (type == F_RDLCK) *tl++ = txdr_unsigned(NFSV4LOCKT_READ); @@ -4397,7 +4401,7 @@ nfsrpc_statfs(vnode_t vp, struct nfsstatfs *sbp, struct nfsfsinfo *fsp, /* * For V4, you actually do a getattr. */ - NFSCL_REQSTART(nd, NFSPROC_GETATTR, vp); + NFSCL_REQSTART(nd, NFSPROC_GETATTR, vp, cred); NFSSTATFS_GETATTRBIT(&attrbits); (void) nfsrv_putattrbit(nd, &attrbits); nd->nd_flag |= ND_USEGSSNAME; @@ -4420,7 +4424,7 @@ nfsrpc_statfs(vnode_t vp, struct nfsstatfs *sbp, struct nfsfsinfo *fsp, if (error) goto nfsmout; } else { - NFSCL_REQSTART(nd, NFSPROC_FSSTAT, vp); + NFSCL_REQSTART(nd, NFSPROC_FSSTAT, vp, NULL); error = nfscl_request(nd, vp, p, cred, stuff); if (error) return (error); @@ -4476,7 +4480,7 @@ nfsrpc_pathconf(vnode_t vp, struct nfsv3_pathconf *pc, /* * For V4, you actually do a getattr. */ - NFSCL_REQSTART(nd, NFSPROC_GETATTR, vp); + NFSCL_REQSTART(nd, NFSPROC_GETATTR, vp, cred); NFSPATHCONF_GETATTRBIT(&attrbits); (void) nfsrv_putattrbit(nd, &attrbits); nd->nd_flag |= ND_USEGSSNAME; @@ -4493,7 +4497,7 @@ nfsrpc_pathconf(vnode_t vp, struct nfsv3_pathconf *pc, error = nd->nd_repstat; } } else { - NFSCL_REQSTART(nd, NFSPROC_PATHCONF, vp); + NFSCL_REQSTART(nd, NFSPROC_PATHCONF, vp, NULL); error = nfscl_request(nd, vp, p, cred, stuff); if (error) return (error); @@ -4529,7 +4533,7 @@ nfsrpc_fsinfo(vnode_t vp, struct nfsfsinfo *fsp, struct ucred *cred, int error; *attrflagp = 0; - NFSCL_REQSTART(nd, NFSPROC_FSINFO, vp); + NFSCL_REQSTART(nd, NFSPROC_FSINFO, vp, cred); error = nfscl_request(nd, vp, p, cred, stuff); if (error) return (error); @@ -4576,10 +4580,10 @@ nfsrpc_renew(struct nfsclclient *clp, struct nfsclds *dsp, struct ucred *cred, return (0); if (dsp == NULL) nfscl_reqstart(nd, NFSPROC_RENEW, nmp, NULL, 0, NULL, NULL, 0, - 0); + 0, cred); else nfscl_reqstart(nd, NFSPROC_RENEW, nmp, NULL, 0, NULL, - &dsp->nfsclds_sess, 0, 0); + &dsp->nfsclds_sess, 0, 0, NULL); if (!NFSHASNFSV4N(nmp)) { /* NFSv4.1 just uses a Sequence Op and not a Renew. */ NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); @@ -4626,11 +4630,11 @@ nfsrpc_rellockown(struct nfsmount *nmp, struct nfscllockowner *lp, if (NFSHASNFSV4N(nmp)) { /* For NFSv4.1, do a FreeStateID. */ nfscl_reqstart(nd, NFSPROC_FREESTATEID, nmp, NULL, 0, NULL, - NULL, 0, 0); + NULL, 0, 0, cred); nfsm_stateidtom(nd, &lp->nfsl_stateid, NFSSTATEID_PUTSTATEID); } else { nfscl_reqstart(nd, NFSPROC_RELEASELCKOWN, nmp, NULL, 0, NULL, - NULL, 0, 0); + NULL, 0, 0, NULL); NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); tsep = nfsmnt_mdssession(nmp); *tl++ = tsep->nfsess_clientid.lval[0]; @@ -4664,7 +4668,7 @@ nfsrpc_getdirpath(struct nfsmount *nmp, u_char *dirpath, struct ucred *cred, u_int32_t *opcntp; nfscl_reqstart(nd, NFSPROC_PUTROOTFH, nmp, NULL, 0, &opcntp, NULL, 0, - 0); + 0, NULL); cp = dirpath; cnt = 0; do { @@ -4731,7 +4735,7 @@ nfsrpc_delegreturn(struct nfscldeleg *dp, struct ucred *cred, int error; nfscl_reqstart(nd, NFSPROC_DELEGRETURN, nmp, dp->nfsdl_fh, - dp->nfsdl_fhlen, NULL, NULL, 0, 0); + dp->nfsdl_fhlen, NULL, NULL, 0, 0, cred); NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID); if (NFSHASNFSV4N(nmp)) *tl++ = 0; @@ -4765,7 +4769,7 @@ nfsrpc_getacl(vnode_t vp, struct ucred *cred, NFSPROC_T *p, if (nfsrv_useacl == 0 || !NFSHASNFSV4(nmp)) return (EOPNOTSUPP); - NFSCL_REQSTART(nd, NFSPROC_GETACL, vp); + NFSCL_REQSTART(nd, NFSPROC_GETACL, vp, cred); NFSZERO_ATTRBIT(&attrbits); NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_ACL); (void) nfsrv_putattrbit(nd, &attrbits); @@ -4811,7 +4815,7 @@ nfsrpc_setaclrpc(vnode_t vp, struct ucred *cred, NFSPROC_T *p, if (!NFSHASNFSV4(nmp)) return (EOPNOTSUPP); - NFSCL_REQSTART(nd, NFSPROC_SETACL, vp); + NFSCL_REQSTART(nd, NFSPROC_SETACL, vp, cred); nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); NFSZERO_ATTRBIT(&attrbits); NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_ACL); @@ -4844,7 +4848,7 @@ nfsrpc_exchangeid(struct nfsmount *nmp, struct nfsclclient *clp, if (minorvers == 0) minorvers = nmp->nm_minorvers; nfscl_reqstart(nd, NFSPROC_EXCHANGEID, nmp, NULL, 0, NULL, NULL, - NFS_VER4, minorvers); + NFS_VER4, minorvers, NULL); NFSM_BUILD(tl, uint32_t *, 2 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(nfsboottime.tv_sec); /* Client owner */ *tl = txdr_unsigned(clp->nfsc_rev); @@ -4940,7 +4944,7 @@ nfsrpc_createsession(struct nfsmount *nmp, struct nfsclsession *sep, else minorvers = NFSV41_MINORVERSION; nfscl_reqstart(nd, NFSPROC_CREATESESSION, nmp, NULL, 0, NULL, NULL, - NFS_VER4, minorvers); + NFS_VER4, minorvers, NULL); NFSM_BUILD(tl, uint32_t *, 4 * NFSX_UNSIGNED); *tl++ = sep->nfsess_clientid.lval[0]; *tl++ = sep->nfsess_clientid.lval[1]; @@ -5071,7 +5075,7 @@ nfsrpc_destroysession(struct nfsmount *nmp, struct nfsclclient *clp, struct nfsclsession *tsep; nfscl_reqstart(nd, NFSPROC_DESTROYSESSION, nmp, NULL, 0, NULL, NULL, 0, - 0); + 0, NULL); NFSM_BUILD(tl, uint32_t *, NFSX_V4SESSIONID); tsep = nfsmnt_mdssession(nmp); bcopy(tsep->nfsess_sessionid, tl, NFSX_V4SESSIONID); @@ -5099,7 +5103,7 @@ nfsrpc_destroyclient(struct nfsmount *nmp, struct nfsclclient *clp, struct nfsclsession *tsep; nfscl_reqstart(nd, NFSPROC_DESTROYCLIENT, nmp, NULL, 0, NULL, NULL, 0, - 0); + 0, NULL); NFSM_BUILD(tl, uint32_t *, 2 * NFSX_UNSIGNED); tsep = nfsmnt_mdssession(nmp); *tl++ = tsep->nfsess_clientid.lval[0]; @@ -5128,7 +5132,7 @@ nfsrpc_layoutget(struct nfsmount *nmp, uint8_t *fhp, int fhlen, int iomode, int error; nfscl_reqstart(nd, NFSPROC_LAYOUTGET, nmp, fhp, fhlen, NULL, NULL, 0, - 0); + 0, cred); nfsrv_setuplayoutget(nd, iomode, offset, len, minlen, stateidp, layouttype, layoutlen, 0); nd->nd_flag |= ND_USEGSSNAME; @@ -5172,7 +5176,7 @@ nfsrpc_getdeviceinfo(struct nfsmount *nmp, uint8_t *deviceid, int layouttype, ndi = NULL; gotdspp = NULL; nfscl_reqstart(nd, NFSPROC_GETDEVICEINFO, nmp, NULL, 0, NULL, NULL, 0, - 0); + 0, cred); NFSM_BUILD(tl, uint32_t *, NFSX_V4DEVICEID + 3 * NFSX_UNSIGNED); NFSBCOPY(deviceid, tl, NFSX_V4DEVICEID); tl += (NFSX_V4DEVICEID / NFSX_UNSIGNED); @@ -5393,7 +5397,7 @@ nfsrpc_layoutcommit(struct nfsmount *nmp, uint8_t *fh, int fhlen, int reclaim, int error; nfscl_reqstart(nd, NFSPROC_LAYOUTCOMMIT, nmp, fh, fhlen, NULL, NULL, - 0, 0); + 0, 0, cred); NFSM_BUILD(tl, uint32_t *, 5 * NFSX_UNSIGNED + 3 * NFSX_HYPER + NFSX_STATEID); txdr_hyper(off, tl); @@ -5444,7 +5448,7 @@ nfsrpc_layoutreturn(struct nfsmount *nmp, uint8_t *fh, int fhlen, int reclaim, int error; nfscl_reqstart(nd, NFSPROC_LAYOUTRETURN, nmp, fh, fhlen, NULL, NULL, - 0, 0); + 0, 0, cred); NFSM_BUILD(tl, uint32_t *, 4 * NFSX_UNSIGNED); if (reclaim != 0) *tl++ = newnfs_true; @@ -5530,7 +5534,7 @@ nfsrpc_layouterror(struct nfsmount *nmp, uint8_t *fh, int fhlen, uint64_t offset int error; nfscl_reqstart(nd, NFSPROC_LAYOUTERROR, nmp, fh, fhlen, NULL, NULL, - 0, 0); + 0, 0, cred); NFSM_BUILD(tl, uint32_t *, 2 * NFSX_HYPER + NFSX_STATEID + NFSX_V4DEVICEID + 3 * NFSX_UNSIGNED); txdr_hyper(offset, tl); tl += 2; @@ -5839,7 +5843,7 @@ nfsrpc_reclaimcomplete(struct nfsmount *nmp, struct ucred *cred, NFSPROC_T *p) int error; nfscl_reqstart(nd, NFSPROC_RECLAIMCOMPL, nmp, NULL, 0, NULL, NULL, 0, - 0); + 0, cred); NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); *tl = newnfs_false; nd->nd_flag |= ND_USEGSSNAME; @@ -6462,7 +6466,8 @@ nfsrpc_readds(vnode_t vp, struct uio *uiop, nfsv4stateid_t *stateidp, int *eofp, nd->nd_mrep = NULL; if (vers == 0 || vers == NFS_VER4) { nfscl_reqstart(nd, NFSPROC_READDS, nmp, fhp->nfh_fh, - fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); + fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, + NULL); vers = NFS_VER4; NFSCL_DEBUG(4, "nfsrpc_readds: vers4 minvers=%d\n", minorvers); if (flex != 0) @@ -6471,7 +6476,8 @@ nfsrpc_readds(vnode_t vp, struct uio *uiop, nfsv4stateid_t *stateidp, int *eofp, nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSEQIDZERO); } else { nfscl_reqstart(nd, NFSPROC_READ, nmp, fhp->nfh_fh, - fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); + fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, + NULL); NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_READ]); NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_READDS]); NFSCL_DEBUG(4, "nfsrpc_readds: vers3\n"); @@ -6538,7 +6544,8 @@ nfsrpc_writeds(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, nd->nd_mrep = NULL; if (vers == 0 || vers == NFS_VER4) { nfscl_reqstart(nd, NFSPROC_WRITEDS, nmp, fhp->nfh_fh, - fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); + fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, + NULL); NFSCL_DEBUG(4, "nfsrpc_writeds: vers4 minvers=%d\n", minorvers); vers = NFS_VER4; if (flex != 0) @@ -6548,7 +6555,8 @@ nfsrpc_writeds(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 2 * NFSX_UNSIGNED); } else { nfscl_reqstart(nd, NFSPROC_WRITE, nmp, fhp->nfh_fh, - fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); + fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, + NULL); NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITE]); NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITEDS]); NFSCL_DEBUG(4, "nfsrpc_writeds: vers3\n"); @@ -6671,7 +6679,8 @@ nfsrpc_writedsmir(vnode_t vp, int *iomode, int *must_commit, nd->nd_mrep = NULL; if (vers == 0 || vers == NFS_VER4) { nfscl_reqstart(nd, NFSPROC_WRITEDS, nmp, fhp->nfh_fh, - fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); + fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, + NULL); vers = NFS_VER4; NFSCL_DEBUG(4, "nfsrpc_writedsmir: vers4 minvers=%d\n", minorvers); @@ -6679,7 +6688,8 @@ nfsrpc_writedsmir(vnode_t vp, int *iomode, int *must_commit, NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 2 * NFSX_UNSIGNED); } else { nfscl_reqstart(nd, NFSPROC_WRITE, nmp, fhp->nfh_fh, - fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); + fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, + NULL); NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITE]); NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITEDS]); NFSCL_DEBUG(4, "nfsrpc_writedsmir: vers3\n"); @@ -6899,11 +6909,13 @@ nfsrpc_commitds(vnode_t vp, uint64_t offset, int cnt, struct nfsclds *dsp, nd->nd_mrep = NULL; if (vers == 0 || vers == NFS_VER4) { nfscl_reqstart(nd, NFSPROC_COMMITDS, nmp, fhp->nfh_fh, - fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); + fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, + NULL); vers = NFS_VER4; } else { nfscl_reqstart(nd, NFSPROC_COMMIT, nmp, fhp->nfh_fh, - fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); + fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, + NULL); NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_COMMIT]); NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_COMMITDS]); } @@ -7018,7 +7030,7 @@ nfsrpc_advise(vnode_t vp, off_t offset, uint64_t cnt, int advise, NFSSETBIT_ATTRBIT(&hints, NFSV4IOHINT_DONTNEED); else return (0); - NFSCL_REQSTART(nd, NFSPROC_IOADVISE, vp); + NFSCL_REQSTART(nd, NFSPROC_IOADVISE, vp, cred); nfsm_stateidtom(nd, NULL, NFSSTATEID_PUTALLZERO); NFSM_BUILD(tl, uint32_t *, 2 * NFSX_HYPER); txdr_hyper(offset, tl); @@ -7062,7 +7074,7 @@ nfsrpc_adviseds(vnode_t vp, uint64_t offset, int cnt, int advise, return (0); nd->nd_mrep = NULL; nfscl_reqstart(nd, NFSPROC_IOADVISEDS, nmp, fhp->nfh_fh, - fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); + fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, NULL); vers = NFS_VER4; NFSCL_DEBUG(4, "nfsrpc_adviseds: vers=%d minvers=%d\n", vers, minorvers); @@ -7232,7 +7244,7 @@ nfsrpc_allocaterpc(vnode_t vp, off_t off, off_t len, nfsv4stateid_t *stateidp, nfsattrbit_t attrbits; *attrflagp = 0; - NFSCL_REQSTART(nd, NFSPROC_ALLOCATE, vp); + NFSCL_REQSTART(nd, NFSPROC_ALLOCATE, vp, cred); nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); NFSM_BUILD(tl, uint32_t *, 2 * NFSX_HYPER + NFSX_UNSIGNED); txdr_hyper(off, tl); tl += 2; @@ -7720,7 +7732,7 @@ nfsrpc_openlayoutrpc(struct nfsmount *nmp, vnode_t vp, u_int8_t *nfhp, *dpp = NULL; *laystatp = ENXIO; nfscl_reqstart(nd, NFSPROC_OPENLAYGET, nmp, nfhp, fhlen, NULL, NULL, - 0, 0); + 0, 0, cred); NFSM_BUILD(tl, uint32_t *, 5 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(op->nfso_own->nfsow_seqid); *tl++ = txdr_unsigned(mode & NFSV4OPEN_ACCESSBOTH); @@ -7905,7 +7917,7 @@ nfsrpc_createlayout(vnode_t dvp, char *name, int namelen, struct vattr *vap, *dattrflagp = 0; if (namelen > NFS_MAXNAMLEN) return (ENAMETOOLONG); - NFSCL_REQSTART(nd, NFSPROC_CREATELAYGET, dvp); + NFSCL_REQSTART(nd, NFSPROC_CREATELAYGET, dvp, cred); /* * For V4, this is actually an Open op. */ @@ -8346,7 +8358,7 @@ nfsrpc_copyrpc(vnode_t invp, off_t inoff, vnode_t outvp, off_t outoff, *lenp = 0; if (len > nfs_maxcopyrange) len = nfs_maxcopyrange; - NFSCL_REQSTART(nd, NFSPROC_COPY, invp); + NFSCL_REQSTART(nd, NFSPROC_COPY, invp, cred); NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_GETATTR); NFSGETATTR_ATTRBIT(&attrbits); @@ -8511,7 +8523,7 @@ nfsrpc_seekrpc(vnode_t vp, off_t *offp, nfsv4stateid_t *stateidp, bool *eofp, nfsattrbit_t attrbits; *attrflagp = 0; - NFSCL_REQSTART(nd, NFSPROC_SEEK, vp); + NFSCL_REQSTART(nd, NFSPROC_SEEK, vp, cred); nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 2 * NFSX_UNSIGNED); txdr_hyper(*offp, tl); tl += 2; @@ -8555,7 +8567,7 @@ nfsrpc_getextattr(vnode_t vp, const char *name, struct uio *uiop, ssize_t *lenp, uint32_t len, len2; *attrflagp = 0; - NFSCL_REQSTART(nd, NFSPROC_GETEXTATTR, vp); + NFSCL_REQSTART(nd, NFSPROC_GETEXTATTR, vp, cred); nfsm_strtom(nd, name, strlen(name)); NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_GETATTR); @@ -8625,7 +8637,7 @@ nfsrpc_setextattr(vnode_t vp, const char *name, struct uio *uiop, nfsattrbit_t attrbits; *attrflagp = 0; - NFSCL_REQSTART(nd, NFSPROC_SETEXTATTR, vp); + NFSCL_REQSTART(nd, NFSPROC_SETEXTATTR, vp, cred); if (uiop->uio_resid > nd->nd_maxreq) { /* nd_maxreq is set by NFSCL_REQSTART(). */ m_freem(nd->nd_mreq); @@ -8673,7 +8685,7 @@ nfsrpc_rmextattr(vnode_t vp, const char *name, struct nfsvattr *nap, nfsattrbit_t attrbits; *attrflagp = 0; - NFSCL_REQSTART(nd, NFSPROC_RMEXTATTR, vp); + NFSCL_REQSTART(nd, NFSPROC_RMEXTATTR, vp, cred); nfsm_strtom(nd, name, strlen(name)); NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_GETATTR); @@ -8713,7 +8725,7 @@ nfsrpc_listextattr(vnode_t vp, uint64_t *cookiep, struct uio *uiop, u_char c; *attrflagp = 0; - NFSCL_REQSTART(nd, NFSPROC_LISTEXTATTR, vp); + NFSCL_REQSTART(nd, NFSPROC_LISTEXTATTR, vp, cred); NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 2 * NFSX_UNSIGNED); txdr_hyper(*cookiep, tl); tl += 2; *tl++ = txdr_unsigned(*lenp); @@ -8887,7 +8899,7 @@ nfsrpc_bindconnsess(CLIENT *cl, void *arg, struct ucred *cr) int error; nfscl_reqstart(nd, NFSPROC_BINDCONNTOSESS, NULL, NULL, 0, NULL, NULL, - NFS_VER4, rcp->minorvers); + NFS_VER4, rcp->minorvers, NULL); NFSM_BUILD(tl, uint32_t *, NFSX_V4SESSIONID + 2 * NFSX_UNSIGNED); memcpy(tl, rcp->sessionid, NFSX_V4SESSIONID); tl += NFSX_V4SESSIONID / NFSX_UNSIGNED; diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index c25edf64094e..be0e0a03fbde 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -5235,7 +5235,7 @@ nfsrv_readdsrpc(fhandle_t *fhp, off_t off, int len, struct ucred *cred, st.other[2] = 0x55555555; st.seqid = 0xffffffff; nfscl_reqstart(nd, NFSPROC_READDS, nmp, (u_int8_t *)fhp, sizeof(*fhp), - NULL, NULL, 0, 0); + NULL, NULL, 0, 0, NULL); nfsm_stateidtom(nd, &st, NFSSTATEID_PUTSTATEID); NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED * 3); txdr_hyper(off, tl); @@ -5343,7 +5343,7 @@ nfsrv_writedsdorpc(struct nfsmount *nmp, fhandle_t *fhp, off_t off, int len, nd = malloc(sizeof(*nd), M_TEMP, M_WAITOK | M_ZERO); nfscl_reqstart(nd, NFSPROC_WRITE, nmp, (u_int8_t *)fhp, - sizeof(fhandle_t), NULL, NULL, 0, 0); + sizeof(fhandle_t), NULL, NULL, 0, 0, NULL); /* * Use a stateid where other is an alternating 01010 pattern and @@ -5565,7 +5565,7 @@ nfsrv_allocatedsdorpc(struct nfsmount *nmp, fhandle_t *fhp, off_t off, nd = malloc(sizeof(*nd), M_TEMP, M_WAITOK | M_ZERO); nfscl_reqstart(nd, NFSPROC_ALLOCATE, nmp, (u_int8_t *)fhp, - sizeof(fhandle_t), NULL, NULL, 0, 0); + sizeof(fhandle_t), NULL, NULL, 0, 0, NULL); /* * Use a stateid where other is an alternating 01010 pattern and @@ -5719,7 +5719,7 @@ nfsrv_setattrdsdorpc(fhandle_t *fhp, struct ucred *cred, NFSPROC_T *p, st.other[2] = 0x55555555; st.seqid = 0xffffffff; nfscl_reqstart(nd, NFSPROC_SETATTR, nmp, (u_int8_t *)fhp, sizeof(*fhp), - NULL, NULL, 0, 0); + NULL, NULL, 0, 0, NULL); nfsm_stateidtom(nd, &st, NFSSTATEID_PUTSTATEID); nfscl_fillsattr(nd, &nap->na_vattr, vp, NFSSATTR_FULL, 0); @@ -5904,7 +5904,7 @@ nfsrv_setacldsdorpc(fhandle_t *fhp, struct ucred *cred, NFSPROC_T *p, st.other[2] = 0x55555555; st.seqid = 0xffffffff; nfscl_reqstart(nd, NFSPROC_SETACL, nmp, (u_int8_t *)fhp, sizeof(*fhp), - NULL, NULL, 0, 0); + NULL, NULL, 0, 0, NULL); nfsm_stateidtom(nd, &st, NFSSTATEID_PUTSTATEID); NFSZERO_ATTRBIT(&attrbits); NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_ACL); @@ -6039,7 +6039,7 @@ nfsrv_getattrdsrpc(fhandle_t *fhp, struct ucred *cred, NFSPROC_T *p, NFSD_DEBUG(4, "in nfsrv_getattrdsrpc\n"); nd = malloc(sizeof(*nd), M_TEMP, M_WAITOK | M_ZERO); nfscl_reqstart(nd, NFSPROC_GETATTR, nmp, (u_int8_t *)fhp, - sizeof(fhandle_t), NULL, NULL, 0, 0); + sizeof(fhandle_t), NULL, NULL, 0, 0, NULL); NFSZERO_ATTRBIT(&attrbits); NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_SIZE); NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_CHANGE); @@ -6107,7 +6107,7 @@ nfsrv_seekdsrpc(fhandle_t *fhp, off_t *offp, int content, bool *eofp, st.seqid = 0xffffffff; nd = malloc(sizeof(*nd), M_TEMP, M_WAITOK | M_ZERO); nfscl_reqstart(nd, NFSPROC_SEEKDS, nmp, (u_int8_t *)fhp, - sizeof(fhandle_t), NULL, NULL, 0, 0); + sizeof(fhandle_t), NULL, NULL, 0, 0, NULL); nfsm_stateidtom(nd, &st, NFSSTATEID_PUTSTATEID); NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + NFSX_UNSIGNED); txdr_hyper(*offp, tl); tl += 2;