diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2008-02-07 21:03:52 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-02-25 15:59:21 -0800 |
commit | f3442df1495a8d424a47c735afa937a74651aa7c (patch) | |
tree | e50624a175e3ce8c8285b14b3108dd1e6e30468a | |
parent | 89f2dc01cfed1c24b3f32af748698de35c3a0cae (diff) |
NFSv2/v3: Fix a memory leak when using -onolock
mainline: 5cef338b30c110daf547fb13d99f0c77f2a79fbc
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 <Trond.Myklebust@netapp.com>
Acked-by: Neil Brown <neilb@suse.de>
Signed-off-by: Neil Brown <neilb@suse.de>
CC: Oliver Pinter <oliver.pntr@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | 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 881fa4900923..4cccff43676c 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c @@ -433,9 +433,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 */ } @@ -781,6 +778,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); |