Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Jul 2018 20:59:00 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r336516 - stable/11/sys/fs/nfsserver
Message-ID:  <201807192059.w6JKx0V4062346@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Thu Jul 19 20:58:59 2018
New Revision: 336516
URL: https://svnweb.freebsd.org/changeset/base/336516

Log:
  MFC: r333766
  Add a missing nfsrv_freesession() call for an unlikely failure case.
  
  Since NFSv4.1 clients normally create a single session which supports
  both fore and back channels, it is unlikely that a callback will fail
  due to a lack of a back channel.
  However, if this failure occurred, the session wasn't being dereferenced
  and would never be free'd.
  Found by inspection during pNFS server development.

Modified:
  stable/11/sys/fs/nfsserver/nfs_nfsdstate.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/fs/nfsserver/nfs_nfsdstate.c
==============================================================================
--- stable/11/sys/fs/nfsserver/nfs_nfsdstate.c	Thu Jul 19 20:23:27 2018	(r336515)
+++ stable/11/sys/fs/nfsserver/nfs_nfsdstate.c	Thu Jul 19 20:58:59 2018	(r336516)
@@ -4254,9 +4254,10 @@ nfsrv_docallback(struct nfsclient *clp, int procnum,
 	 */
 	(void) newnfs_sndlock(&clp->lc_req.nr_lock);
 	if (clp->lc_req.nr_client == NULL) {
-		if ((clp->lc_flags & LCL_NFSV41) != 0)
+		if ((clp->lc_flags & LCL_NFSV41) != 0) {
 			error = ECONNREFUSED;
-		else if (nd->nd_procnum == NFSV4PROC_CBNULL)
+			nfsrv_freesession(sep, NULL);
+		} else if (nd->nd_procnum == NFSV4PROC_CBNULL)
 			error = newnfs_connect(NULL, &clp->lc_req, cred,
 			    NULL, 1);
 		else



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807192059.w6JKx0V4062346>