From: "Oliver Pinter (Pintér Olivér)" <oliver.pntr@gmail.com>
To: "Linux Kernel" <linux-kernel@vger.kernel.org>,
stable@kernel.org, stable-commits@vger.kernel.org
Cc: "chrisw@sous-sol.org" <chrisw@sous-sol.org>,
"Greg KH" <gregkh@suse.de>, "Willy Tarreau" <w@1wt.eu>,
"Adrian Bunk" <bunk@kernel.org>,
"Trond Myklebust" <Trond.Myklebust@netapp.com>,
"Neil Brown" <neilb@suse.de>
Subject: [2.6.22.y] {15/17} - nfs-unmount-leak.patch - series for stable kernel #2
Date: Sat, 2 Feb 2008 02:34:38 +0100 [thread overview]
Message-ID: <6101e8c40802011734q30246d66jcd08d17f9a541af3@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 72 bytes --]
mainline: 13ef7b69b54aa8ae4ed264d0bf41339737f8543a
--
Thanks,
Oliver
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: nfs-unmount-leak.patch --]
[-- Type: text/x-diff; name=nfs-unmount-leak.patch, Size: 1730 bytes --]
From: Trond Myklebust <Trond.Myklebust@netapp.com>
Date: Tue Dec 11 11:05:19 2007 -0500
Subject: NFSv2/v3: Fix a memory leak when using -onolock
Patch-mainline: 2.6.24
References: 336253
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>
---
fs/nfs/client.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- linux-2.6.22-SL103_BRANCH.orig/fs/nfs/client.c
+++ linux-2.6.22-SL103_BRANCH/fs/nfs/client.c
@@ -433,9 +433,6 @@ static int nfs_create_rpc_client(struct
*/
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 */
}
@@ -771,6 +768,9 @@ void nfs_free_server(struct nfs_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);
next reply other threads:[~2008-02-02 1:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-02 1:34 Oliver Pinter (Pintér Olivér) [this message]
2008-02-06 23:03 ` Oliver Pinter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6101e8c40802011734q30246d66jcd08d17f9a541af3@mail.gmail.com \
--to=oliver.pntr@gmail.com \
--cc=Trond.Myklebust@netapp.com \
--cc=bunk@kernel.org \
--cc=chrisw@sous-sol.org \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=neilb@suse.de \
--cc=stable-commits@vger.kernel.org \
--cc=stable@kernel.org \
--cc=w@1wt.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®