nfs4: Add assertions for unexpected error codes

There are some NFS4 error codes we should not get if the client is operating
correctly.
CLID_INUSE may be caused only by incorrectly generated SETCLIENTID request.
NOFILEHANDLE, RESTOREFH and OP_ILLEGAL indicate that the client has sent
an incorrectly build request.
BAD_STATEID and BAD_SEQID indicate a bug in handling {open,lock}_owners.
LOCK_HELD happens when the client incorrectly cleans up after accessing a file.
This commit is contained in:
Pawel Dziepak
2012-12-24 20:27:07 +01:00
parent eed5b716d0
commit aa5a8cb346
@@ -20,6 +20,15 @@ NFS4Object::HandleErrors(uint32 nfs4Error, RPC::Server* serv,
{ {
uint32 leaseTime; uint32 leaseTime;
// No request send by the client should cause any of the following errors.
ASSERT(nfs4Error != NFS4ERR_CLID_INUSE);
ASSERT(nfs4Error != NFS4ERR_NOFILEHANDLE);
ASSERT(nfs4Error != NFS4ERR_BAD_STATEID);
ASSERT(nfs4Error != NFS4ERR_BAD_SEQID);
ASSERT(nfs4Error != NFS4ERR_RESTOREFH);
ASSERT(nfs4Error != NFS4ERR_LOCK_HELD);
ASSERT(nfs4Error != NFS4ERR_OP_ILLEGAL);
if (cookie != NULL) if (cookie != NULL)
state = cookie->fOpenState; state = cookie->fOpenState;