nfs4: Fix cookie and vnode creation in create() hook
This commit is contained in:
@@ -77,7 +77,7 @@ Cookie::CancelAll()
|
|||||||
mutex_lock(&fRequestLock);
|
mutex_lock(&fRequestLock);
|
||||||
RequestEntry* ent = fRequests;
|
RequestEntry* ent = fRequests;
|
||||||
while (ent != NULL) {
|
while (ent != NULL) {
|
||||||
fInode->FileSystem()->Server()->WakeCall(ent->fRequest);
|
fFilesystem->Server()->WakeCall(ent->fRequest);
|
||||||
ent = ent->fNext;
|
ent = ent->fNext;
|
||||||
}
|
}
|
||||||
mutex_unlock(&fRequestLock);
|
mutex_unlock(&fRequestLock);
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
|
|
||||||
#include "Filesystem.h"
|
#include "Filesystem.h"
|
||||||
|
|
||||||
class Inode;
|
|
||||||
|
|
||||||
struct Cookie {
|
struct Cookie {
|
||||||
struct RequestEntry {
|
struct RequestEntry {
|
||||||
@@ -21,7 +20,7 @@ struct Cookie {
|
|||||||
RequestEntry* fNext;
|
RequestEntry* fNext;
|
||||||
};
|
};
|
||||||
|
|
||||||
Inode* fInode;
|
Filesystem* fFilesystem;
|
||||||
RequestEntry* fRequests;
|
RequestEntry* fRequests;
|
||||||
mutex fRequestLock;
|
mutex fRequestLock;
|
||||||
|
|
||||||
|
|||||||
@@ -712,8 +712,6 @@ Inode::Create(const char* name, int mode, int perms, OpenFileCookie* cookie,
|
|||||||
bool confirm;
|
bool confirm;
|
||||||
status_t result;
|
status_t result;
|
||||||
|
|
||||||
cookie->fInode = this;
|
|
||||||
cookie->fHandle = fHandle;
|
|
||||||
cookie->fMode = mode;
|
cookie->fMode = mode;
|
||||||
cookie->fSequence = 0;
|
cookie->fSequence = 0;
|
||||||
|
|
||||||
@@ -811,6 +809,9 @@ Inode::Create(const char* name, int mode, int perms, OpenFileCookie* cookie,
|
|||||||
|
|
||||||
fFilesystem->InoIdMap()->AddEntry(fi, *id);
|
fFilesystem->InoIdMap()->AddEntry(fi, *id);
|
||||||
|
|
||||||
|
cookie->fFilesystem = fFilesystem;
|
||||||
|
cookie->fHandle = fh;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
} while (true);
|
} while (true);
|
||||||
|
|
||||||
@@ -829,7 +830,7 @@ Inode::Open(int mode, OpenFileCookie* cookie)
|
|||||||
bool confirm;
|
bool confirm;
|
||||||
status_t result;
|
status_t result;
|
||||||
|
|
||||||
cookie->fInode = this;
|
cookie->fFilesystem = fFilesystem;
|
||||||
cookie->fHandle = fHandle;
|
cookie->fHandle = fHandle;
|
||||||
cookie->fMode = mode;
|
cookie->fMode = mode;
|
||||||
cookie->fSequence = 0;
|
cookie->fSequence = 0;
|
||||||
@@ -1131,7 +1132,7 @@ Inode::OpenDir(OpenDirCookie* cookie)
|
|||||||
if (allowed & ACCESS4_READ != ACCESS4_READ)
|
if (allowed & ACCESS4_READ != ACCESS4_READ)
|
||||||
return B_PERMISSION_DENIED;
|
return B_PERMISSION_DENIED;
|
||||||
|
|
||||||
cookie->fInode = this;
|
cookie->fFilesystem = fFilesystem;
|
||||||
cookie->fCookie = 0;
|
cookie->fCookie = 0;
|
||||||
cookie->fCookieVerf = 2;
|
cookie->fCookieVerf = 2;
|
||||||
|
|
||||||
|
|||||||
@@ -278,6 +278,11 @@ nfs4_create(fs_volume* volume, fs_vnode* dir, const char* name, int openMode,
|
|||||||
if (result != B_OK)
|
if (result != B_OK)
|
||||||
delete cookie;
|
delete cookie;
|
||||||
|
|
||||||
|
void* ptr;
|
||||||
|
result = get_vnode(volume, *_newVnodeID, &ptr);
|
||||||
|
if (result != B_OK)
|
||||||
|
delete cookie;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user