Date: Tue, 17 Jul 2018 12:13:38 +0000 (UTC) From: Rick Macklem <rmacklem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r336413 - in projects/pnfs-planb-server/sys/fs: nfs nfsserver Message-ID: <201807171213.w6HCDclN006777@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rmacklem Date: Tue Jul 17 12:13:38 2018 New Revision: 336413 URL: https://svnweb.freebsd.org/changeset/base/336413 Log: Update the NFS server code with recent changes in head for handling the ESXi 6.7 client. There should be no effect on the pNFS server itself. Modified: projects/pnfs-planb-server/sys/fs/nfs/nfsproto.h projects/pnfs-planb-server/sys/fs/nfsserver/nfs_nfsdport.c projects/pnfs-planb-server/sys/fs/nfsserver/nfs_nfsdserv.c projects/pnfs-planb-server/sys/fs/nfsserver/nfs_nfsdstate.c Modified: projects/pnfs-planb-server/sys/fs/nfs/nfsproto.h ============================================================================== --- projects/pnfs-planb-server/sys/fs/nfs/nfsproto.h Tue Jul 17 12:01:59 2018 (r336412) +++ projects/pnfs-planb-server/sys/fs/nfs/nfsproto.h Tue Jul 17 12:13:38 2018 (r336413) @@ -568,6 +568,7 @@ #define NFSV4OPEN_WDRESOURCE 0x00080000 #define NFSV4OPEN_WDCONTENTION 0x00100000 #define NFSV4OPEN_WDNOTWANTED 0x00200000 +#define NFSV4OPEN_WDSUPPFTYPE 0x00400000 /* * NFS V4 File Handle types Modified: projects/pnfs-planb-server/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- projects/pnfs-planb-server/sys/fs/nfsserver/nfs_nfsdport.c Tue Jul 17 12:01:59 2018 (r336412) +++ projects/pnfs-planb-server/sys/fs/nfsserver/nfs_nfsdport.c Tue Jul 17 12:13:38 2018 (r336413) @@ -2101,6 +2101,7 @@ nfsrvd_readdirplus(struct nfsrv_descript *nd, int isdg } fullsiz = siz; nd->nd_repstat = getret = nfsvno_getattr(vp, &at, nd, p, 1, NULL); +#if 0 if (!nd->nd_repstat) { if (off && verf != at.na_filerev) { /* @@ -2109,17 +2110,14 @@ nfsrvd_readdirplus(struct nfsrv_descript *nd, int isdg * removed/added unless that offset cookies returned to * the client are no longer valid. */ -#if 0 if (nd->nd_flag & ND_NFSV4) { nd->nd_repstat = NFSERR_NOTSAME; } else { nd->nd_repstat = NFSERR_BAD_COOKIE; } -#endif - } else if ((nd->nd_flag & ND_NFSV4) && off == 0 && verf != 0) { - nd->nd_repstat = NFSERR_BAD_COOKIE; } } +#endif if (!nd->nd_repstat && vp->v_type != VDIR) nd->nd_repstat = NFSERR_NOTDIR; if (!nd->nd_repstat && cnt == 0) @@ -4466,8 +4464,8 @@ tryagain: NFSUNLOCKMNT(failnmp); ds = nfsrv_deldsnmp(PNFSDOP_DELDSSERVER, failnmp, p); - NFSD_DEBUG(4, "nfsrv_proxyds: deldsnmp fail=%d " - "ds=%p\n", failpos, ds); + NFSD_DEBUG(4, "dsldsnmp fail=%d ds=%p\n", + failpos, ds); if (ds != NULL) nfsrv_killrpcs(failnmp); NFSLOCKMNT(failnmp); Modified: projects/pnfs-planb-server/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- projects/pnfs-planb-server/sys/fs/nfsserver/nfs_nfsdserv.c Tue Jul 17 12:01:59 2018 (r336412) +++ projects/pnfs-planb-server/sys/fs/nfsserver/nfs_nfsdserv.c Tue Jul 17 12:13:38 2018 (r336413) @@ -3095,7 +3095,13 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int is *tl = txdr_unsigned(NFSV4OPEN_DELEGATEWRITE); else if (retext != 0) { *tl = txdr_unsigned(NFSV4OPEN_DELEGATENONEEXT); - if ((rflags & NFSV4OPEN_WDCONTENTION) != 0) { + if ((rflags & NFSV4OPEN_WDNOTWANTED) != 0) { + NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); + *tl = txdr_unsigned(NFSV4OPEN_NOTWANTED); + } else if ((rflags & NFSV4OPEN_WDSUPPFTYPE) != 0) { + NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); + *tl = txdr_unsigned(NFSV4OPEN_NOTSUPPFTYPE); + } else if ((rflags & NFSV4OPEN_WDCONTENTION) != 0) { NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(NFSV4OPEN_CONTENTION); *tl = newnfs_false; @@ -4230,9 +4236,16 @@ nfsrvd_reclaimcomplete(struct nfsrv_descript *nd, __un goto nfsmout; } NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); - if (*tl == newnfs_true) - nd->nd_repstat = NFSERR_NOTSUPP; - else + /* + * I believe that a ReclaimComplete with rca_one_fs == TRUE is only + * to be used after a file system has been transferred to a different + * file server. However, RFC5661 is somewhat vague w.r.t. this and + * the ESXi 6.7 client does both a ReclaimComplete with rca_one_fs + * == TRUE and one with ReclaimComplete with rca_one_fs == FALSE. + * Therefore, just ignore the rca_one_fs == TRUE operation and return + * NFS_OK without doing anything. + */ + if (*tl == newnfs_false) nd->nd_repstat = nfsrv_checkreclaimcomplete(nd); nfsmout: NFSEXITCODE2(error, nd); Modified: projects/pnfs-planb-server/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- projects/pnfs-planb-server/sys/fs/nfsserver/nfs_nfsdstate.c Tue Jul 17 12:01:59 2018 (r336412) +++ projects/pnfs-planb-server/sys/fs/nfsserver/nfs_nfsdstate.c Tue Jul 17 12:13:38 2018 (r336413) @@ -3097,7 +3097,13 @@ tryagain: /* * This is where we can choose to issue a delegation. */ - if (delegate == 0 || writedeleg == 0 || + if ((new_stp->ls_flags & NFSLCK_WANTNODELEG) != 0) + *rflagsp |= NFSV4OPEN_WDNOTWANTED; + else if (nfsrv_issuedelegs == 0) + *rflagsp |= NFSV4OPEN_WDSUPPFTYPE; + else if (NFSRV_V4DELEGLIMIT(nfsrv_delegatecnt)) + *rflagsp |= NFSV4OPEN_WDRESOURCE; + else if (delegate == 0 || writedeleg == 0 || NFSVNO_EXRDONLY(exp) || (readonly != 0 && nfsrv_writedelegifpos == 0) || !NFSVNO_DELEGOK(vp) || @@ -3105,11 +3111,6 @@ tryagain: (clp->lc_flags & (LCL_CALLBACKSON | LCL_CBDOWN)) != LCL_CALLBACKSON) *rflagsp |= NFSV4OPEN_WDCONTENTION; - else if (nfsrv_issuedelegs == 0 || - NFSRV_V4DELEGLIMIT(nfsrv_delegatecnt)) - *rflagsp |= NFSV4OPEN_WDRESOURCE; - else if ((new_stp->ls_flags & NFSLCK_WANTNODELEG) != 0) - *rflagsp |= NFSV4OPEN_WDNOTWANTED; else { new_deleg->ls_stateid.seqid = delegstateidp->seqid = 1; new_deleg->ls_stateid.other[0] = delegstateidp->other[0] @@ -3160,16 +3161,17 @@ tryagain: /* * This is where we can choose to issue a delegation. */ - if (delegate == 0 || (writedeleg == 0 && readonly == 0) || - !NFSVNO_DELEGOK(vp) || + if ((new_stp->ls_flags & NFSLCK_WANTNODELEG) != 0) + *rflagsp |= NFSV4OPEN_WDNOTWANTED; + else if (nfsrv_issuedelegs == 0) + *rflagsp |= NFSV4OPEN_WDSUPPFTYPE; + else if (NFSRV_V4DELEGLIMIT(nfsrv_delegatecnt)) + *rflagsp |= NFSV4OPEN_WDRESOURCE; + else if (delegate == 0 || (writedeleg == 0 && + readonly == 0) || !NFSVNO_DELEGOK(vp) || (clp->lc_flags & (LCL_CALLBACKSON | LCL_CBDOWN)) != LCL_CALLBACKSON) *rflagsp |= NFSV4OPEN_WDCONTENTION; - else if (nfsrv_issuedelegs == 0 || - NFSRV_V4DELEGLIMIT(nfsrv_delegatecnt)) - *rflagsp |= NFSV4OPEN_WDRESOURCE; - else if ((new_stp->ls_flags & NFSLCK_WANTNODELEG) != 0) - *rflagsp |= NFSV4OPEN_WDNOTWANTED; else { new_deleg->ls_stateid.seqid = delegstateidp->seqid = 1; new_deleg->ls_stateid.other[0] = delegstateidp->other[0]
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807171213.w6HCDclN006777>