Author: rmacklem
Date: Thu May 17 21:17:20 2018
New Revision: 333766
URL: https://svnweb.freebsd.org/changeset/base/333766

Log:
  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.
  
  Tested by:    andreas.n...@frequentis.com
  MFC after:    2 months

Modified:
  head/sys/fs/nfsserver/nfs_nfsdstate.c

Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c
==============================================================================
--- head/sys/fs/nfsserver/nfs_nfsdstate.c       Thu May 17 21:04:19 2018        
(r333765)
+++ head/sys/fs/nfsserver/nfs_nfsdstate.c       Thu May 17 21:17:20 2018        
(r333766)
@@ -4255,9 +4255,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
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to