added 1 changeset to branch 'refs/remotes/pdziepak-github/nfs4' old head: eed5b716d0d47b766659295406c54f910dc1a092 new head: aa5a8cb346abcd13bd7c401f2e82153b661235e3 overview: https://github.com/pdziepak/Haiku/compare/eed5b71...aa5a8cb ---------------------------------------------------------------------------- aa5a8cb: 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. [ Pawel Dziepak <pdziepak@xxxxxxxxxxx> ] ---------------------------------------------------------------------------- Commit: aa5a8cb346abcd13bd7c401f2e82153b661235e3 Author: Pawel Dziepak <pdziepak@xxxxxxxxxxx> Date: Mon Dec 24 19:27:07 2012 UTC ---------------------------------------------------------------------------- 1 file changed, 9 insertions(+) src/add-ons/kernel/file_systems/nfs4/NFS4Object.cpp | 9 +++++++++ ---------------------------------------------------------------------------- diff --git a/src/add-ons/kernel/file_systems/nfs4/NFS4Object.cpp b/src/add-ons/kernel/file_systems/nfs4/NFS4Object.cpp index c4949a4..f13d34e 100644 --- a/src/add-ons/kernel/file_systems/nfs4/NFS4Object.cpp +++ b/src/add-ons/kernel/file_systems/nfs4/NFS4Object.cpp @@ -20,6 +20,15 @@ NFS4Object::HandleErrors(uint32 nfs4Error, RPC::Server* serv, { 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) state = cookie->fOpenState;