nfs4: Fix CID 991174: improve error checking in NFS4Inode::OpenFile()

This commit is contained in:
Pawel Dziepak 2013-03-19 01:11:20 +01:00
parent 271d1540b1
commit b42b242f62

View File

@ -609,10 +609,8 @@ NFS4Inode::OpenFile(OpenState* state, int mode, OpenDelegationData* delegation)
} }
result = reply.Verify(); result = reply.Verify();
if (result != B_OK) { if (result != B_OK)
fFileSystem->OpenOwnerSequenceUnlock(sequence); fFileSystem->OpenOwnerSequenceUnlock(sequence);
return result;
}
if (result != B_OK && reply.NFS4Error() == NFS4ERR_NOT_SAME) if (result != B_OK && reply.NFS4Error() == NFS4ERR_NOT_SAME)
return B_ENTRY_NOT_FOUND; return B_ENTRY_NOT_FOUND;
@ -623,10 +621,13 @@ NFS4Inode::OpenFile(OpenState* state, int mode, OpenDelegationData* delegation)
reply.PutFH(); reply.PutFH();
result = reply.Open(state->fStateID, &state->fStateSeq, &confirm, result = reply.Open(state->fStateID, &state->fStateSeq, &confirm,
delegation); delegation);
if (result != B_OK) {
fFileSystem->OpenOwnerSequenceUnlock(sequence);
return result;
}
FileHandle handle; FileHandle handle;
reply.GetFH(&handle); result = reply.GetFH(&handle);
if (result != B_OK) { if (result != B_OK) {
fFileSystem->OpenOwnerSequenceUnlock(sequence); fFileSystem->OpenOwnerSequenceUnlock(sequence);
return result; return result;
@ -638,7 +639,7 @@ NFS4Inode::OpenFile(OpenState* state, int mode, OpenDelegationData* delegation)
state->fOpened = true; state->fOpened = true;
if (confirm) if (confirm)
result = ConfirmOpen(fInfo.fHandle, state, &sequence); result = ConfirmOpen(fInfo.fHandle, state, &sequence);
fFileSystem->OpenOwnerSequenceUnlock(sequence); fFileSystem->OpenOwnerSequenceUnlock(sequence);
return result; return result;