Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320225
b: refs/heads/master
c: de73483
h: refs/heads/master
i:
  320223: 0d9240a
v: v3
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed Jul 16, 2012
1 parent 07d63c2 commit 6be3595
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 35 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: 46a87b8a7b939900d779042da7097bf330ab787f
refs/heads/master: de734831224e74fcaf8917386e33644c4243db95
47 changes: 16 additions & 31 deletions trunk/fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4029,42 +4029,28 @@ int nfs4_proc_setclientid(struct nfs_client *clp, u32 program,
.rpc_resp = res,
.rpc_cred = cred,
};
int loop = 0;
int status;

/* nfs_client_id4 */
nfs4_init_boot_verifier(clp, &sc_verifier);

for(;;) {
rcu_read_lock();
setclientid.sc_name_len = scnprintf(setclientid.sc_name,
sizeof(setclientid.sc_name), "%s/%s %s %s %u",
clp->cl_ipaddr,
rpc_peeraddr2str(clp->cl_rpcclient,
RPC_DISPLAY_ADDR),
rpc_peeraddr2str(clp->cl_rpcclient,
RPC_DISPLAY_PROTO),
clp->cl_rpcclient->cl_auth->au_ops->au_name,
clp->cl_id_uniquifier);
setclientid.sc_netid_len = scnprintf(setclientid.sc_netid,
rcu_read_lock();
setclientid.sc_name_len = scnprintf(setclientid.sc_name,
sizeof(setclientid.sc_name), "%s/%s %s",
clp->cl_ipaddr,
rpc_peeraddr2str(clp->cl_rpcclient,
RPC_DISPLAY_ADDR),
rpc_peeraddr2str(clp->cl_rpcclient,
RPC_DISPLAY_PROTO));
/* cb_client4 */
setclientid.sc_netid_len = scnprintf(setclientid.sc_netid,
sizeof(setclientid.sc_netid),
rpc_peeraddr2str(clp->cl_rpcclient,
RPC_DISPLAY_NETID));
setclientid.sc_uaddr_len = scnprintf(setclientid.sc_uaddr,
rcu_read_unlock();
setclientid.sc_uaddr_len = scnprintf(setclientid.sc_uaddr,
sizeof(setclientid.sc_uaddr), "%s.%u.%u",
clp->cl_ipaddr, port >> 8, port & 255);
rcu_read_unlock();

status = rpc_call_sync(clp->cl_rpcclient, &msg, RPC_TASK_TIMEOUT);
if (status != -NFS4ERR_CLID_INUSE)
break;
if (loop != 0) {
++clp->cl_id_uniquifier;
break;
}
++loop;
ssleep(clp->cl_lease_time / HZ + 1);
}
return status;
return rpc_call_sync(clp->cl_rpcclient, &msg, RPC_TASK_TIMEOUT);
}

int nfs4_proc_setclientid_confirm(struct nfs_client *clp,
Expand Down Expand Up @@ -5262,10 +5248,9 @@ int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred)
nfs4_init_boot_verifier(clp, &verifier);

args.id_len = scnprintf(args.id, sizeof(args.id),
"%s/%s/%u",
"%s/%s",
clp->cl_ipaddr,
clp->cl_rpcclient->cl_nodename,
clp->cl_rpcclient->cl_auth->au_flavor);
clp->cl_rpcclient->cl_nodename);

res.server_owner = kzalloc(sizeof(struct nfs41_server_owner),
GFP_NOFS);
Expand Down
7 changes: 6 additions & 1 deletion trunk/fs/nfs/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -1606,10 +1606,15 @@ static int nfs4_handle_reclaim_lease_error(struct nfs_client *clp, int status)
return -ESERVERFAULT;
/* Lease confirmation error: retry after purging the lease */
ssleep(1);
case -NFS4ERR_CLID_INUSE:
case -NFS4ERR_STALE_CLIENTID:
clear_bit(NFS4CLNT_LEASE_CONFIRM, &clp->cl_state);
break;
case -NFS4ERR_CLID_INUSE:
pr_err("NFS: Server %s reports our clientid is in use\n",
clp->cl_hostname);
nfs_mark_client_ready(clp, -EPERM);
clear_bit(NFS4CLNT_LEASE_CONFIRM, &clp->cl_state);
return -EPERM;
case -EACCES:
if (clp->cl_machine_cred == NULL)
return -EACCES;
Expand Down
3 changes: 1 addition & 2 deletions trunk/include/linux/nfs_fs_sb.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,9 @@ struct nfs_client {
struct idmap * cl_idmap;

/* Our own IP address, as a null-terminated string.
* This is used to generate the clientid, and the callback address.
* This is used to generate the mv0 callback address.
*/
char cl_ipaddr[48];
unsigned char cl_id_uniquifier;
u32 cl_cb_ident; /* v4.0 callback identifier */
const struct nfs4_minor_version_ops *cl_mvops;

Expand Down

0 comments on commit 6be3595

Please sign in to comment.