NFSv2/v3: Fix a memory leak when using -onolock
commitecfa052f58d6c10bc87865594c94cf3820897e9f
authorGreg KH <gregkh@suse.de>
Fri, 22 Feb 2008 21:31:31 +0000 (22 13:31 -0800)
committerOliver Pinter <oliver.pntr@gmail.com>
Sat, 23 Feb 2008 20:05:19 +0000 (23 21:05 +0100)
tree5644d0da1f0c2d96540abd1296b2f0fcc34ee23d
parentee6ef1bc5ed358bdde8363d5c76944ad43e4350d
NFSv2/v3: Fix a memory leak when using -onolock

2.6.22-stable review patch.  If anyone has any objections, please let us
know.

------------------

From: Trond Myklebust <Trond.Myklebust@netapp.com>

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>
Signed-off-by: Oliver Pinter <oliver.pntr@gmail.com>
fs/nfs/client.c