Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 153626
b: refs/heads/master
c: a21bdd9
h: refs/heads/master
v: v3
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed Jun 18, 2009
1 parent 88b57be commit 2fb2440
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c381ad2cf2d5dcd3991bcc8a18fddd9d5c66ccaa
refs/heads/master: a21bdd9b960ccce421b63aa0e3efda4fcdc26f10
12 changes: 8 additions & 4 deletions trunk/fs/nfs/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,16 @@ static struct nfs_client *nfs_alloc_client(const struct nfs_client_initdata *cl_
{
struct nfs_client *clp;
struct rpc_cred *cred;
int err = -ENOMEM;

if ((clp = kzalloc(sizeof(*clp), GFP_KERNEL)) == NULL)
goto error_0;

clp->rpc_ops = cl_init->rpc_ops;

if (cl_init->rpc_ops->version == 4) {
if (nfs_callback_up() < 0)
err = nfs_callback_up();
if (err < 0)
goto error_2;
__set_bit(NFS_CS_CALLBACK, &clp->cl_res_state);
}
Expand All @@ -133,6 +135,7 @@ static struct nfs_client *nfs_alloc_client(const struct nfs_client_initdata *cl_
clp->cl_addrlen = cl_init->addrlen;

if (cl_init->hostname) {
err = -ENOMEM;
clp->cl_hostname = kstrdup(cl_init->hostname, GFP_KERNEL);
if (!clp->cl_hostname)
goto error_3;
Expand Down Expand Up @@ -165,7 +168,7 @@ static struct nfs_client *nfs_alloc_client(const struct nfs_client_initdata *cl_
error_2:
kfree(clp);
error_0:
return NULL;
return ERR_PTR(err);
}

static void nfs4_shutdown_client(struct nfs_client *clp)
Expand Down Expand Up @@ -456,9 +459,10 @@ static struct nfs_client *nfs_get_client(const struct nfs_client_initdata *cl_in
spin_unlock(&nfs_client_lock);

new = nfs_alloc_client(cl_init);
} while (new);
} while (!IS_ERR(new));

return ERR_PTR(-ENOMEM);
dprintk("--> nfs_get_client() = %ld [failed]\n", PTR_ERR(new));
return new;

/* install a new client and return with it unready */
install_client:
Expand Down

0 comments on commit 2fb2440

Please sign in to comment.