diff options
author | J. Bruce Fields <bfields@redhat.com> | 2012-05-12 20:37:23 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-05-31 20:29:54 -0400 |
commit | 136e658d621f71b67982dda51a2327830146ef9d (patch) | |
tree | 17ba8c7424310d869c1b08a1f9cc11fcd19241b1 /fs/nfsd | |
parent | 2dbb269dfed9e8653be81d49e8f109a243bea25c (diff) |
nfsd4: rearrange exchange_id logic to simplify
Minor cleanup: it's simpler to have separate code paths for the update
and non-update cases.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4state.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 93fcf53daee1..491f13a70db1 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -1557,36 +1557,36 @@ nfsd4_exchange_id(struct svc_rqst *rqstp, | |||
1557 | bool creds_match = same_creds(&conf->cl_cred, &rqstp->rq_cred); | 1557 | bool creds_match = same_creds(&conf->cl_cred, &rqstp->rq_cred); |
1558 | bool verfs_match = same_verf(&verf, &conf->cl_verifier); | 1558 | bool verfs_match = same_verf(&verf, &conf->cl_verifier); |
1559 | 1559 | ||
1560 | if (!clp_used_exchangeid(conf)) { | 1560 | if (update) { |
1561 | if (update) { /* buggy client */ | 1561 | if (!clp_used_exchangeid(conf)) { /* buggy client */ |
1562 | status = nfserr_inval; | 1562 | status = nfserr_inval; |
1563 | goto out; | 1563 | goto out; |
1564 | } | 1564 | } |
1565 | } | 1565 | if (!creds_match) { /* case 9 */ |
1566 | if (!creds_match) { /* case 9 */ | ||
1567 | if (update) | ||
1568 | status = nfserr_perm; | 1566 | status = nfserr_perm; |
1569 | else /* case 3 */ | 1567 | goto out; |
1570 | status = nfserr_clid_inuse; | 1568 | } |
1571 | goto out; | 1569 | if (!verfs_match) { /* case 8 */ |
1572 | } | ||
1573 | if (!verfs_match) { /* case 8 */ | ||
1574 | if (update) { | ||
1575 | status = nfserr_not_same; | 1570 | status = nfserr_not_same; |
1576 | goto out; | 1571 | goto out; |
1577 | } | 1572 | } |
1578 | /* case 5, client reboot */ | 1573 | /* case 6 */ |
1579 | expire_client(conf); | 1574 | exid->flags |= EXCHGID4_FLAG_CONFIRMED_R; |
1580 | goto out_new; | 1575 | new = conf; |
1576 | goto out_copy; | ||
1581 | } | 1577 | } |
1582 | if (!clp_used_exchangeid(conf)) { | 1578 | if (!creds_match) { /* case 3 */ |
1583 | status = nfserr_inval; | 1579 | status = nfserr_clid_inuse; |
1584 | goto out; | 1580 | goto out; |
1585 | } | 1581 | } |
1586 | /* case 2 */ | 1582 | if (verfs_match) { /* case 2 */ |
1587 | exid->flags |= EXCHGID4_FLAG_CONFIRMED_R; | 1583 | exid->flags |= EXCHGID4_FLAG_CONFIRMED_R; |
1588 | new = conf; | 1584 | new = conf; |
1589 | goto out_copy; | 1585 | goto out_copy; |
1586 | } | ||
1587 | /* case 5, client reboot */ | ||
1588 | expire_client(conf); | ||
1589 | goto out_new; | ||
1590 | } | 1590 | } |
1591 | 1591 | ||
1592 | if (update) { /* case 7 */ | 1592 | if (update) { /* case 7 */ |