svn commit: r324074 - head/sys/fs/nfsclient
Rick Macklem
rmacklem at FreeBSD.org
Wed Sep 27 23:23:43 UTC 2017
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) {
More information about the svn-src-head
mailing list