Date: Sat, 14 Jul 2018 20:39:10 +0000 (UTC) From: Rick Macklem <rmacklem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r336295 - in projects/pnfs-planb-server/sys/fs: nfs nfsclient Message-ID: <201807142039.w6EKdA9i048998@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rmacklem Date: Sat Jul 14 20:39:10 2018 New Revision: 336295 URL: https://svnweb.freebsd.org/changeset/base/336295 Log: Add code to the pNFS client so that it shuts down a TCP connection to a DS when a renew operation (actually just a Sequence Op) fails due to ENXIO. Not particularily critical, but without this patch the client just does a TCP reconnect attempt every 30sec. Also, make the call to nfscl_cancelreqs() unconditional, since it checks for NFSCLDS_SAMECONN and it does so with the lock held. Modified: projects/pnfs-planb-server/sys/fs/nfs/nfs_var.h projects/pnfs-planb-server/sys/fs/nfsclient/nfs_clrpcops.c projects/pnfs-planb-server/sys/fs/nfsclient/nfs_clstate.c Modified: projects/pnfs-planb-server/sys/fs/nfs/nfs_var.h ============================================================================== --- projects/pnfs-planb-server/sys/fs/nfs/nfs_var.h Sat Jul 14 20:14:00 2018 (r336294) +++ projects/pnfs-planb-server/sys/fs/nfs/nfs_var.h Sat Jul 14 20:39:10 2018 (r336295) @@ -603,6 +603,7 @@ struct nfscllayout *nfscl_getlayout(struct nfsclclient uint64_t, struct nfsclflayout **, int *); void nfscl_dserr(uint32_t, uint32_t, struct nfscldevinfo *, struct nfscllayout *, struct nfsclds *); +void nfscl_cancelreqs(struct nfsclds *); void nfscl_rellayout(struct nfscllayout *, int); struct nfscldevinfo *nfscl_getdevinfo(struct nfsclclient *, uint8_t *, struct nfscldevinfo *); Modified: projects/pnfs-planb-server/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- projects/pnfs-planb-server/sys/fs/nfsclient/nfs_clrpcops.c Sat Jul 14 20:14:00 2018 (r336294) +++ projects/pnfs-planb-server/sys/fs/nfsclient/nfs_clrpcops.c Sat Jul 14 20:39:10 2018 (r336295) @@ -4408,9 +4408,12 @@ nfsrpc_renew(struct nfsclclient *clp, struct nfsclds * if (dsp == NULL) error = newnfs_request(nd, nmp, NULL, nrp, NULL, p, cred, NFS_PROG, NFS_VER4, NULL, 1, NULL, NULL); - else + else { error = newnfs_request(nd, nmp, NULL, nrp, NULL, p, cred, NFS_PROG, NFS_VER4, NULL, 1, NULL, &dsp->nfsclds_sess); + if (error == ENXIO) + nfscl_cancelreqs(dsp); + } if (error) return (error); error = nd->nd_repstat; Modified: projects/pnfs-planb-server/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- projects/pnfs-planb-server/sys/fs/nfsclient/nfs_clstate.c Sat Jul 14 20:14:00 2018 (r336294) +++ projects/pnfs-planb-server/sys/fs/nfsclient/nfs_clstate.c Sat Jul 14 20:39:10 2018 (r336295) @@ -125,7 +125,6 @@ static struct nfscldeleg *nfscl_finddeleg(struct nfscl static void nfscl_retoncloselayout(vnode_t, struct nfsclclient *, uint8_t *, int, struct nfsclrecalllayout **); static void nfscl_reldevinfo_locked(struct nfscldevinfo *); -static void nfscl_cancelreqs(struct nfsclds *); static struct nfscllayout *nfscl_findlayout(struct nfsclclient *, u_int8_t *, int); static struct nfscldevinfo *nfscl_finddevinfo(struct nfsclclient *, uint8_t *); @@ -5001,16 +5000,17 @@ nfscl_dserr(uint32_t op, uint32_t stat, struct nfsclde free(recallp, M_NFSLAYRECALL); } - /* If the connection isn't used for other DSs, we can shut it down. */ - if ((dsp->nfsclds_flags & NFSCLDS_SAMECONN) == 0) - nfscl_cancelreqs(dsp); + /* And shut the TCP connection down. */ + nfscl_cancelreqs(dsp); } /* * Cancel all RPCs for this "dsp" by closing the connection. * Also, mark the session as defunct. + * If NFSCLDS_SAMECONN is set, the connection is shared with other DSs and + * cannot be shut down. */ -static void +APPLESTATIC void nfscl_cancelreqs(struct nfsclds *dsp) { struct __rpc_client *cl;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807142039.w6EKdA9i048998>