Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309847
b: refs/heads/master
c: 2dbb269
h: refs/heads/master
i:
  309845: e22cbe5
  309843: 7199556
  309839: d308f6d
v: v3
  • Loading branch information
J. Bruce Fields committed Jun 1, 2012
1 parent f2d73e2 commit 50debf4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 27 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: 83e08fd46cea3b59dce9285461e3854b594042af
refs/heads/master: 2dbb269dfed9e8653be81d49e8f109a243bea25c
36 changes: 10 additions & 26 deletions trunk/fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -1550,72 +1550,56 @@ nfsd4_exchange_id(struct svc_rqst *rqstp,

strhashval = clientstr_hashval(dname);

/* Cases below refer to rfc 5661 section 18.35.4: */
nfs4_lock_state();
conf = find_confirmed_client_by_str(dname, strhashval);
if (conf) {
bool creds_match = same_creds(&conf->cl_cred, &rqstp->rq_cred);
bool verfs_match = same_verf(&verf, &conf->cl_verifier);

if (!clp_used_exchangeid(conf)) {
if (update) {
status = nfserr_inval; /* buggy client */
if (update) { /* buggy client */
status = nfserr_inval;
goto out;
}
}
if (!creds_match) {
/* 18.35.4 case 9 */
if (!creds_match) { /* case 9 */
if (update)
status = nfserr_perm;
else /* case 3 */
status = nfserr_clid_inuse;
goto out;
}
if (!verfs_match) {
/* 18.35.4 case 8 */
if (!verfs_match) { /* case 8 */
if (update) {
status = nfserr_not_same;
goto out;
}
/* Client reboot: destroy old state */
/* case 5, client reboot */
expire_client(conf);
goto out_new;
}
if (!clp_used_exchangeid(conf)) {
status = nfserr_inval;
goto out;
}
/*
* Set bit when the owner id and verifier map to an already
* confirmed client id (18.35.3).
*/
/* case 2 */
exid->flags |= EXCHGID4_FLAG_CONFIRMED_R;

/*
* Falling into 18.35.4 case 2, possible router replay.
* Leave confirmed record intact and return same result.
*/
new = conf;
goto out_copy;
}

/* 18.35.4 case 7 */
if (update) {
if (update) { /* case 7 */
status = nfserr_noent;
goto out;
}

unconf = find_unconfirmed_client_by_str(dname, strhashval);
if (unconf) {
/*
* Possible retry or client restart. Per 18.35.4 case 4,
* a new unconfirmed record should be generated regardless
* of whether any properties have changed.
*/
if (unconf) /* case 4, possible retry or client restart */
expire_client(unconf);
}

/* case 1 (normal case) */
out_new:
/* Normal case */
new = create_client(exid->clname, dname, rqstp, &verf);
if (new == NULL) {
status = nfserr_jukebox;
Expand Down

0 comments on commit 50debf4

Please sign in to comment.