Operations that have a stateid and a sequence number ---------------------------------------------------- CLOSE, LOCK, LOCKU, OPEN_DOWNGRADE, OPEN_CONFIRM (stateid in verifier otherwise server can't locate lockowner) NOTE: the server cannot deallocate the information associated with a CLOSE'd state until another request with the next sequence number arrives for the same lockowner, or the client reboots, or there is no longer any locking state for that owner and the server receives nothing from that lockowner for a while and forgets the associated lockowner information, yada, yada, yada. check stateid / | \ \ / | \ \ / \ \ \ / \ \ \_______ / | \ \ stale good old bad / | \ | | | | server can't bump seq num | | | client undo seq num increment | | | don't renew lease | | | NFSERR_BAD_STATEID seq knowlege is | \ reset on client | \ and server | check sequence number NFS4ERR_STALE_STATEID | / \ | bad or good replay (should hit this) | | send from replay cache | | | good: server increment seq num | good: client leaves seq num alone | NFSERR_OLD_STATEID | check sequence number / | \ / | \ / | \ bad replay good / | \ don't bump seqnum | \ don't renew lease? | \ NFS4ERR_BAD_SEQ_NUM | \ | \ don't bump seq num \ return replay \ | | check lease | | | bad good | / \ check lease don't renew lease / | renew / | lease bad good / | / | NFS4ERR_EXPIRED | seq num bumped | | | renew lease perform operation Operations that have a sequence number, and no stateid ------------------------------------------------------ OPEN check clientid / \ bad good / | don't bump seq num | don't renew lease | NFS4ERR_STALE_CLIENTID | | check sequence number / | \ / | \ / | \ bad replay good / | \ don't bump seqnum | \ don't renew lease | \ NFS4ERR_BAD_SEQ_NUM | \ | \ don't bump seq num \ return replay \ | | check lease | | | bad good | / \ check lease don't renew lease / | renew / | lease bad good / | / | NFS4ERR_EXPIRED | (seq num bumped) | | | renew lease perform operation Operations that have a stateid and no sequence number ------------------------------------------------------ READ, WRITE, RENEW, SETATTR for TRUNCATE This case is clear, the lease is renewed only if the stateid is valid. check stateid / \ bad good / | don't renew lease | NFS4ERR_XXX_STATEID | | | check lease / | bad good / | / | NFS4ERR_EXPIRED | | | renew lease perform operation