Mercurial > illumos > nfs4.1
changeset 13896:1cc105502105
exchange_id: Check on verifier first
Now credits are checked before verifier, therefore if client reboots and
tries EXCHANGE_ID with other auxiliary GID, client will get NFS4ERR_CLID_INUSE.
Bug #1320
author | Vitaliy Gusev <gusev.vitaliy@nexenta.com> |
---|---|
date | Fri, 12 Aug 2011 06:55:35 +0400 |
parents | 3f10965f523b |
children | b980e4810c6d |
files | usr/src/uts/common/fs/nfs/nfs41_srv.c |
diffstat | 1 files changed, 21 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/uts/common/fs/nfs/nfs41_srv.c Fri Aug 12 01:37:11 2011 +0400 +++ b/usr/src/uts/common/fs/nfs/nfs41_srv.c Fri Aug 12 06:55:35 2011 +0400 @@ -7339,7 +7339,27 @@ old_verifier_arg = cp->rc_nfs_client.verifier; if (CLID_REC_CONFIRMED(cp)) { if (!update) { - if (!rfs4_cmp_cred_princ(cp->rc_cr_set, cs)) { + if (old_verifier_arg != cip->verifier) { + /* case 5 - utok */ + /* + * previous incarnation of clientid is first + * hidden such that any subsequent lookups + * will not find it in DB, then the current + * reference to it is dropped; this will + * force the reaper thread to clean it up. + */ + ocp = cp; + mds_clean_up_sessions(ocp); + rfs4_dbe_hide(ocp->rc_dbe); + rfs4_client_rele(ocp); + + cp = client_record(cip, cs); + ASSERT(cp != NULL); + *cs->statusp = resp->eir_status = NFS4_OK; + rok->eir_clientid = cp->rc_clientid; + rok->eir_sequenceid = cp->rc_contrived.xi_sid; + /* trickle down to "out" */ + } else if (!rfs4_cmp_cred_princ(cp->rc_cr_set, cs)) { /* case 3 */ if (rfs4_lease_expired(cp)) { rfs4_client_close(cp); @@ -7362,26 +7382,6 @@ rok->eir_sequenceid = cp->rc_contrived.xi_sid; /* trickle down to "out" */ - } else if (old_verifier_arg != cip->verifier) { - /* case 5 - utok */ - /* - * previous incarnation of clientid is first - * hidden such that any subsequent lookups - * will not find it in DB, then the current - * reference to it is dropped; this will - * force the reaper thread to clean it up. - */ - ocp = cp; - mds_clean_up_sessions(ocp); - rfs4_dbe_hide(ocp->rc_dbe); - rfs4_client_rele(ocp); - - cp = client_record(cip, cs); - ASSERT(cp != NULL); - *cs->statusp = resp->eir_status = NFS4_OK; - rok->eir_clientid = cp->rc_clientid; - rok->eir_sequenceid = cp->rc_contrived.xi_sid; - /* trickle down to "out" */ } else { /* something is really wacky in srv state */ *cs->statusp = resp->eir_status =