diff options
author | J. Bruce Fields <bfields@redhat.com> | 2012-05-14 09:47:11 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-05-31 20:29:53 -0400 |
commit | 2dbb269dfed9e8653be81d49e8f109a243bea25c (patch) | |
tree | c9102bb541e4b7e21a0b78bbc61b739e4ac4abb4 /fs/nfsd | |
parent | 83e08fd46cea3b59dce9285461e3854b594042af (diff) |
nfsd4: exchange_id cleanup: comments
Make these comments a bit more concise and uniform.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4state.c | 36 |
1 files changed, 10 insertions, 26 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 3b6d61008673..93fcf53daee1 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -1550,6 +1550,7 @@ nfsd4_exchange_id(struct svc_rqst *rqstp, | |||
1550 | 1550 | ||
1551 | strhashval = clientstr_hashval(dname); | 1551 | strhashval = clientstr_hashval(dname); |
1552 | 1552 | ||
1553 | /* Cases below refer to rfc 5661 section 18.35.4: */ | ||
1553 | nfs4_lock_state(); | 1554 | nfs4_lock_state(); |
1554 | conf = find_confirmed_client_by_str(dname, strhashval); | 1555 | conf = find_confirmed_client_by_str(dname, strhashval); |
1555 | if (conf) { | 1556 | if (conf) { |
@@ -1557,26 +1558,24 @@ nfsd4_exchange_id(struct svc_rqst *rqstp, | |||
1557 | bool verfs_match = same_verf(&verf, &conf->cl_verifier); | 1558 | bool verfs_match = same_verf(&verf, &conf->cl_verifier); |
1558 | 1559 | ||
1559 | if (!clp_used_exchangeid(conf)) { | 1560 | if (!clp_used_exchangeid(conf)) { |
1560 | if (update) { | 1561 | if (update) { /* buggy client */ |
1561 | status = nfserr_inval; /* buggy client */ | 1562 | status = nfserr_inval; |
1562 | goto out; | 1563 | goto out; |
1563 | } | 1564 | } |
1564 | } | 1565 | } |
1565 | if (!creds_match) { | 1566 | if (!creds_match) { /* case 9 */ |
1566 | /* 18.35.4 case 9 */ | ||
1567 | if (update) | 1567 | if (update) |
1568 | status = nfserr_perm; | 1568 | status = nfserr_perm; |
1569 | else /* case 3 */ | 1569 | else /* case 3 */ |
1570 | status = nfserr_clid_inuse; | 1570 | status = nfserr_clid_inuse; |
1571 | goto out; | 1571 | goto out; |
1572 | } | 1572 | } |
1573 | if (!verfs_match) { | 1573 | if (!verfs_match) { /* case 8 */ |
1574 | /* 18.35.4 case 8 */ | ||
1575 | if (update) { | 1574 | if (update) { |
1576 | status = nfserr_not_same; | 1575 | status = nfserr_not_same; |
1577 | goto out; | 1576 | goto out; |
1578 | } | 1577 | } |
1579 | /* Client reboot: destroy old state */ | 1578 | /* case 5, client reboot */ |
1580 | expire_client(conf); | 1579 | expire_client(conf); |
1581 | goto out_new; | 1580 | goto out_new; |
1582 | } | 1581 | } |
@@ -1584,38 +1583,23 @@ nfsd4_exchange_id(struct svc_rqst *rqstp, | |||
1584 | status = nfserr_inval; | 1583 | status = nfserr_inval; |
1585 | goto out; | 1584 | goto out; |
1586 | } | 1585 | } |
1587 | /* | 1586 | /* case 2 */ |
1588 | * Set bit when the owner id and verifier map to an already | ||
1589 | * confirmed client id (18.35.3). | ||
1590 | */ | ||
1591 | exid->flags |= EXCHGID4_FLAG_CONFIRMED_R; | 1587 | exid->flags |= EXCHGID4_FLAG_CONFIRMED_R; |
1592 | |||
1593 | /* | ||
1594 | * Falling into 18.35.4 case 2, possible router replay. | ||
1595 | * Leave confirmed record intact and return same result. | ||
1596 | */ | ||
1597 | new = conf; | 1588 | new = conf; |
1598 | goto out_copy; | 1589 | goto out_copy; |
1599 | } | 1590 | } |
1600 | 1591 | ||
1601 | /* 18.35.4 case 7 */ | 1592 | if (update) { /* case 7 */ |
1602 | if (update) { | ||
1603 | status = nfserr_noent; | 1593 | status = nfserr_noent; |
1604 | goto out; | 1594 | goto out; |
1605 | } | 1595 | } |
1606 | 1596 | ||
1607 | unconf = find_unconfirmed_client_by_str(dname, strhashval); | 1597 | unconf = find_unconfirmed_client_by_str(dname, strhashval); |
1608 | if (unconf) { | 1598 | if (unconf) /* case 4, possible retry or client restart */ |
1609 | /* | ||
1610 | * Possible retry or client restart. Per 18.35.4 case 4, | ||
1611 | * a new unconfirmed record should be generated regardless | ||
1612 | * of whether any properties have changed. | ||
1613 | */ | ||
1614 | expire_client(unconf); | 1599 | expire_client(unconf); |
1615 | } | ||
1616 | 1600 | ||
1601 | /* case 1 (normal case) */ | ||
1617 | out_new: | 1602 | out_new: |
1618 | /* Normal case */ | ||
1619 | new = create_client(exid->clname, dname, rqstp, &verf); | 1603 | new = create_client(exid->clname, dname, rqstp, &verf); |
1620 | if (new == NULL) { | 1604 | if (new == NULL) { |
1621 | status = nfserr_jukebox; | 1605 | status = nfserr_jukebox; |