OpenVZ Forum


Home » Mailing lists » Devel » [PATCH v2 00/12] NFS: callback threads containerization
Re: [PATCH v3] NFS: put net on idr allocation failure [message #46467 is a reply to message #46435] Tue, 22 May 2012 14:37 Go to previous messageGo to previous message
Myklebust, Trond is currently offline  Myklebust, Trond
Messages: 52
Registered: November 2011
Member
On Tue, 2012-05-22 at 12:03 +0400, Stanislav Kinsbursky wrote:
> Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
> ---
> fs/nfs/client.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/fs/nfs/client.c b/fs/nfs/client.c
> index 44cd70f..ae29d4f 100644
> --- a/fs/nfs/client.c
> +++ b/fs/nfs/client.c
> @@ -176,8 +176,10 @@ static struct nfs_client *nfs_alloc_client(const struct nfs_client_initdata *cl_
>
> #ifdef CONFIG_NFS_V4
> err = nfs_get_cb_ident_idr(clp, cl_init->minorversion);
> - if (err)
> + if (err) {
> + put_net(clp->net);
> goto error_cleanup;
> + }
>
> spin_lock_init(&clp->cl_lock);
> INIT_DELAYED_WORK(&clp->cl_renewd, nfs4_renew_state);
>

Let's just move the actual get_net() call to the end of the function.

--
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@netapp.com
www.netapp.com
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [RFC] memcg: propagate kmem limiting information to children
Next Topic: [PATCH] NFS: init client before declaration
Goto Forum:
  


Current Time: Tue Jul 15 21:52:24 GMT 2025

Total time taken to generate the page: 0.03987 seconds