Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5cef338b30c110daf547fb13d99f0c77f2a79fbc
Commit:     5cef338b30c110daf547fb13d99f0c77f2a79fbc
Parent:     4584f520e1f773082ef44ff4f8969a5d992b16ec
Author:     Trond Myklebust <[EMAIL PROTECTED]>
AuthorDate: Tue Dec 11 22:01:56 2007 -0500
Committer:  Trond Myklebust <[EMAIL PROTECTED]>
CommitDate: Tue Dec 11 22:01:56 2007 -0500

    NFSv2/v3: Fix a memory leak when using -onolock
    
    Neil Brown said:
    > Hi Trond,
    >
    > We found that a machine which made moderately heavy use of
    > 'automount' was leaking some nfs data structures - particularly the
    > 4K allocated by rpc_alloc_iostats.
    > It turns out that this only happens with filesystems with -onolock
    > set.
    
    > The problem is that if NFS_MOUNT_NONLM is set, nfs_start_lockd doesn't
    > set server->destroy, so when the filesystem is unmounted, the
    > ->client_acl is not shutdown, and so several resources are still
    > held.  Multiple mount/umount cycles will slowly eat away memory
    > several pages at a time.
    
    Signed-off-by: Trond Myklebust <[EMAIL PROTECTED]>
    Acked-by: NeilBrown <[EMAIL PROTECTED]>
---
 fs/nfs/client.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 70587f3..a6f6254 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -410,9 +410,6 @@ static int nfs_create_rpc_client(struct nfs_client *clp, 
int proto,
  */
 static void nfs_destroy_server(struct nfs_server *server)
 {
-       if (!IS_ERR(server->client_acl))
-               rpc_shutdown_client(server->client_acl);
-
        if (!(server->flags & NFS_MOUNT_NONLM))
                lockd_down();   /* release rpc.lockd */
 }
@@ -755,6 +752,9 @@ void nfs_free_server(struct nfs_server *server)
 
        if (server->destroy != NULL)
                server->destroy(server);
+
+       if (!IS_ERR(server->client_acl))
+               rpc_shutdown_client(server->client_acl);
        if (!IS_ERR(server->client))
                rpc_shutdown_client(server->client);
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to