nfs4: NFS4Object::HandleErrors needs OpenState or OpenFileCookie object
This commit is contained in:
@@ -539,7 +539,7 @@ NFS4Inode::OpenFile(OpenState* state, int mode)
|
||||
|
||||
ReplyInterpreter& reply = request.Reply();
|
||||
|
||||
if (HandleErrors(reply.NFS4Error(), serv))
|
||||
if (HandleErrors(reply.NFS4Error(), serv, NULL, state))
|
||||
continue;
|
||||
|
||||
// Verify if the file we want to open is the file this Inode
|
||||
@@ -592,7 +592,7 @@ NFS4Inode::ReadFile(OpenFileCookie* cookie, OpenState* state, uint64 position,
|
||||
|
||||
ReplyInterpreter& reply = request.Reply();
|
||||
|
||||
if (HandleErrors(reply.NFS4Error(), serv, cookie))
|
||||
if (HandleErrors(reply.NFS4Error(), serv, cookie, state))
|
||||
continue;
|
||||
|
||||
reply.PutFH();
|
||||
@@ -625,7 +625,7 @@ NFS4Inode::WriteFile(OpenFileCookie* cookie, OpenState* state, uint64 position,
|
||||
|
||||
ReplyInterpreter& reply = request.Reply();
|
||||
|
||||
if (HandleErrors(reply.NFS4Error(), serv, cookie))
|
||||
if (HandleErrors(reply.NFS4Error(), serv, cookie, state))
|
||||
continue;
|
||||
|
||||
reply.PutFH();
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
bool
|
||||
NFS4Object::HandleErrors(uint32 nfs4Error, RPC::Server* serv,
|
||||
OpenFileCookie* cookie)
|
||||
OpenFileCookie* cookie, OpenState* state)
|
||||
{
|
||||
uint32 leaseTime;
|
||||
|
||||
@@ -62,8 +62,14 @@ NFS4Object::HandleErrors(uint32 nfs4Error, RPC::Server* serv,
|
||||
// server has rebooted, reclaim share and try again
|
||||
case NFS4ERR_STALE_CLIENTID:
|
||||
case NFS4ERR_STALE_STATEID:
|
||||
if (cookie != NULL) {
|
||||
fFileSystem->NFSServer()->ServerRebooted(cookie->fClientID);
|
||||
return true;
|
||||
} else if (state != NULL) {
|
||||
fFileSystem->NFSServer()->ServerRebooted(state->fClientID);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
// FileHandle has expired
|
||||
case NFS4ERR_FHEXPIRED:
|
||||
@@ -82,6 +88,9 @@ NFS4Object::HandleErrors(uint32 nfs4Error, RPC::Server* serv,
|
||||
if (cookie != NULL) {
|
||||
fFileSystem->NFSServer()->ClientId(cookie->fClientID, true);
|
||||
return true;
|
||||
} else if (state != NULL) {
|
||||
fFileSystem->NFSServer()->ClientId(state->fClientID, true);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ class OpenState;
|
||||
class NFS4Object {
|
||||
public:
|
||||
bool HandleErrors(uint32 nfs4Error, RPC::Server* serv,
|
||||
OpenFileCookie* cookie = NULL);
|
||||
OpenFileCookie* cookie = NULL, OpenState* state = NULL);
|
||||
|
||||
status_t ConfirmOpen(const FileHandle& fileHandle, OpenState* state);
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ OpenState::Close()
|
||||
|
||||
ReplyInterpreter& reply = request.Reply();
|
||||
|
||||
if (HandleErrors(reply.NFS4Error(), serv))
|
||||
if (HandleErrors(reply.NFS4Error(), serv, NULL, this))
|
||||
continue;
|
||||
|
||||
reply.PutFH();
|
||||
|
||||
Reference in New Issue
Block a user