nfs4: Fix handling of retried CLOSE requests

This commit is contained in:
Pawel Dziepak
2013-01-03 03:25:34 +01:00
parent 345a659337
commit 6136b82b1e
2 changed files with 14 additions and 1 deletions
@@ -24,7 +24,6 @@ NFS4Object::HandleErrors(uint32 nfs4Error, RPC::Server* serv,
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_LOCKS_HELD);
ASSERT(nfs4Error != NFS4ERR_OP_ILLEGAL);
@@ -36,6 +35,12 @@ NFS4Object::HandleErrors(uint32 nfs4Error, RPC::Server* serv,
case NFS4_OK:
return false;
// retransmission of CLOSE caused seqid to fall back
case NFS4ERR_BAD_SEQID:
ASSERT(sequence != NULL);
(*sequence)++;
return true;
// server needs more time, we need to wait
case NFS4ERR_LOCKED:
case NFS4ERR_DELAY:
@@ -290,6 +290,14 @@ OpenState::Close()
sequence += IncrementSequence(reply.NFS4Error());
// RFC 3530 8.10.1. Some servers does not do anything to help client
// recognize retried CLOSE requests so we just assume that BAD_STATEID
// on CLOSE request is just a result of retransmission.
if (reply.NFS4Error() == NFS4ERR_BAD_STATEID) {
fFileSystem->OpenOwnerSequenceUnlock(sequence);
return B_OK;
}
if (HandleErrors(reply.NFS4Error(), serv, NULL, this, &sequence))
continue;
fFileSystem->OpenOwnerSequenceUnlock(sequence);