Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 349449
b: refs/heads/master
c: 4ae19c2
h: refs/heads/master
i:
  349447: 89e3177
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Jan 27, 2013
1 parent ff9a368 commit f7aa593
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 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: dee972b967ae111ad5705733de17a3bfc4632311
refs/heads/master: 4ae19c2dd713edb7b8ad3d4ab9d234ed5dcb6b98
31 changes: 15 additions & 16 deletions trunk/fs/nfs/nfs4client.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,10 @@ struct nfs_client *nfs4_init_client(struct nfs_client *clp,
error = nfs4_discover_server_trunking(clp, &old);
if (error < 0)
goto error;
nfs_put_client(clp);
if (clp != old) {
clp->cl_preserve_clid = true;
nfs_put_client(clp);
clp = old;
atomic_inc(&clp->cl_count);
}

return clp;
Expand Down Expand Up @@ -306,7 +305,7 @@ int nfs40_walk_client_list(struct nfs_client *new,
.clientid = new->cl_clientid,
.confirm = new->cl_confirm,
};
int status;
int status = -NFS4ERR_STALE_CLIENTID;

spin_lock(&nn->nfs_client_lock);
list_for_each_entry_safe(pos, n, &nn->nfs_client_list, cl_share_link) {
Expand All @@ -332,28 +331,28 @@ int nfs40_walk_client_list(struct nfs_client *new,

if (prev)
nfs_put_client(prev);
prev = pos;

status = nfs4_proc_setclientid_confirm(pos, &clid, cred);
if (status == 0) {
switch (status) {
case -NFS4ERR_STALE_CLIENTID:
break;
case 0:
nfs4_swap_callback_idents(pos, new);

nfs_put_client(pos);
prev = NULL;
*result = pos;
dprintk("NFS: <-- %s using nfs_client = %p ({%d})\n",
__func__, pos, atomic_read(&pos->cl_count));
return 0;
}
if (status != -NFS4ERR_STALE_CLIENTID) {
nfs_put_client(pos);
dprintk("NFS: <-- %s status = %d, no result\n",
__func__, status);
return status;
default:
goto out;
}

spin_lock(&nn->nfs_client_lock);
prev = pos;
}
spin_unlock(&nn->nfs_client_lock);

out:
/*
* No matching nfs_client found. This should be impossible,
* because the new nfs_client has already been added to
Expand All @@ -363,9 +362,8 @@ int nfs40_walk_client_list(struct nfs_client *new,
*/
if (prev)
nfs_put_client(prev);
spin_unlock(&nn->nfs_client_lock);
pr_err("NFS: %s Error: no matching nfs_client found\n", __func__);
return -NFS4ERR_STALE_CLIENTID;
dprintk("NFS: <-- %s status = %d\n", __func__, status);
return status;
}

#ifdef CONFIG_NFS_V4_1
Expand Down Expand Up @@ -473,6 +471,7 @@ int nfs41_walk_client_list(struct nfs_client *new,
if (!nfs4_match_serverowners(pos, new))
continue;

atomic_inc(&pos->cl_count);
spin_unlock(&nn->nfs_client_lock);
dprintk("NFS: <-- %s using nfs_client = %p ({%d})\n",
__func__, pos, atomic_read(&pos->cl_count));
Expand Down

0 comments on commit f7aa593

Please sign in to comment.