Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Oct 2017 23:42:30 +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-10@freebsd.org
Subject:   svn commit: r324545 - stable/10/sys/fs/nfsclient
Message-ID:  <201710112342.v9BNgUjn052893@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Wed Oct 11 23:42:29 2017
New Revision: 324545
URL: https://svnweb.freebsd.org/changeset/base/324545

Log:
  MFC: r324074
  Fix a memory leak that occurred in the pNFS client.
  
  When a "pnfs" NFSv4.1 mount was unmounted, it didn't free up the layouts
  and deviceinfo structures. This leak only affects "pnfs" mounts and only
  when the mount is umounted.
  Found while testing the pNFS Flexible File layout client code.

Modified:
  stable/10/sys/fs/nfsclient/nfs_clstate.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/fs/nfsclient/nfs_clstate.c
==============================================================================
--- stable/10/sys/fs/nfsclient/nfs_clstate.c	Wed Oct 11 23:33:50 2017	(r324544)
+++ stable/10/sys/fs/nfsclient/nfs_clstate.c	Wed Oct 11 23:42:29 2017	(r324545)
@@ -1627,6 +1627,14 @@ nfscl_cleanclient(struct nfsclclient *clp)
 {
 	struct nfsclowner *owp, *nowp;
 	struct nfsclopen *op, *nop;
+	struct nfscllayout *lyp, *nlyp;
+	struct nfscldevinfo *dip, *ndip;
+
+	TAILQ_FOREACH_SAFE(lyp, &clp->nfsc_layout, nfsly_list, nlyp)
+		nfscl_freelayout(lyp);
+
+	LIST_FOREACH_SAFE(dip, &clp->nfsc_devinfo, nfsdi_list, ndip)
+		nfscl_freedevinfo(dip);
 
 	/* Now, all the OpenOwners, etc. */
 	LIST_FOREACH_SAFE(owp, &clp->nfsc_owner, nfsow_list, nowp) {



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