• Andy Adamson's avatar
    nfsd41: exchange_id operation · 0733d213
    Andy Adamson authored
    Implement the exchange_id operation confoming to
    http://tools.ietf.org/html/draft-ietf-nfsv4-minorversion1-28
    
    Based on the client provided name, hash a client id.
    If a confirmed one is found, compare the op's creds and
    verifier.  If the creds match and the verifier is different
    then expire the old client (client re-incarnated), otherwise,
    if both match, assume it's a replay and ignore it.
    
    If an unconfirmed client is found, then copy the new creds
    and verifer if need update, otherwise assume replay.
    
    The client is moved to a confirmed state on create_session.
    
    In the nfs41 branch set the exchange_id flags to
    EXCHGID4_FLAG_USE_NON_PNFS | EXCHGID4_FLAG_SUPP_MOVED_REFER
    (pNFS is not supported, Referrals are supported,
    Migration is not.).
    
    Address various scenarios from section 18.35 of the spec:
    
    1. Check for EXCHGID4_FLAG_UPD_CONFIRMED_REC_A and set
       EXCHGID4_FLAG_CONFIRMED_R as appropriate.
    
    2. Return error codes per 18.35.4 scenarios.
    
    3. Update client records or generate new client ids depending on
       scenario.
    
    Note: 18.35.4 case 3 probably still needs revisiting.  The handling
    seems not quite right.
    Signed-off-by: default avatarBenny Halevy <bhalevy@panasas.com>
    Signed-off-by: default avatarAndy Adamosn <andros@netapp.com>
    Signed-off-by: default avatarBenny Halevy <bhalevy@panasas.com>
    [nfsd41: use utsname for major_id (and copy to server_scope)]
    [nfsd41: fix handling of various exchange id scenarios]
    Signed-off-by: default avatarMike Sager <sager@netapp.com>
    Signed-off-by: default avatarBenny Halevy <bhalevy@panasas.com>
    [nfsd41: reverse use of EXCHGID4_INVAL_FLAG_MASK_A]
    [simplify nfsd4_encode_exchange_id error handling]
    [nfsd41: embed an xdr_netobj in nfsd4_exchange_id]
    [nfsd41: return nfserr_serverfault for spa_how == SP4_MACH_CRED]
    Signed-off-by: default avatarBenny Halevy <bhalevy@panasas.com>
    Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
    0733d213
nfs4state.c 93.3 KB