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) {
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to