nfs4: VFS uses signed offsets while NFS4 expects unsigned

This commit is contained in:
Pawel Dziepak 2013-03-12 17:36:53 +01:00
parent 1a0386d743
commit c5a88cf7e6
2 changed files with 7 additions and 3 deletions

View File

@ -696,9 +696,13 @@ Inode::TestLock(OpenFileCookie* cookie, struct flock* lock)
LockType ltype = sGetLockType(lock->l_type, false);
uint64 position = lock->l_start;
uint64 length = lock->l_len;
bool conflict;
uint64 length;
if (lock->l_len + lock->l_start == OFF_MAX)
length = UINT64_MAX;
else
length = lock->l_len;
bool conflict;
result = NFS4Inode::TestLock(cookie, &ltype, &position, &length, conflict);
if (result != B_OK)
return result;

View File

@ -234,7 +234,7 @@ ReplyInterpreter::Lock(LockInfo* linfo)
status_t
ReplyInterpreter::LockT(uint64* pos, uint64* len, LockType* type)
{
status_t res = _OperationError(OpLockU);
status_t res = _OperationError(OpLockT);
if (res != B_WOULD_BLOCK || NFS4Error() != NFS4ERR_DENIED)
return res;