Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Sep 2017 23:23:42 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r324074 - head/sys/fs/nfsclient
Message-ID:  <201709272323.v8RNNgD8013132@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Wed Sep 27 23:23:41 2017
New Revision: 324074
URL: https://svnweb.freebsd.org/changeset/base/324074

Log:
  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.
  
  MFC after:	2 weeks

Modified:
  head/sys/fs/nfsclient/nfs_clstate.c

Modified: head/sys/fs/nfsclient/nfs_clstate.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clstate.c	Wed Sep 27 23:18:57 2017	(r324073)
+++ head/sys/fs/nfsclient/nfs_clstate.c	Wed Sep 27 23:23:41 2017	(r324074)
@@ -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?201709272323.v8RNNgD8013132>