diff --git a/src/system/kernel/fs/rootfs.c b/src/system/kernel/fs/rootfs.c index 9abc49b58f..703ac2592c 100644 --- a/src/system/kernel/fs/rootfs.c +++ b/src/system/kernel/fs/rootfs.c @@ -313,7 +313,7 @@ rootfs_mount(mount_id id, const char *device, uint32 flags, const char *args, return B_NO_MEMORY; fs->id = id; - fs->next_vnode_id = 0; + fs->next_vnode_id = 1; err = mutex_init(&fs->lock, "rootfs_mutex"); if (err < B_OK) diff --git a/src/system/kernel/fs/vfs.cpp b/src/system/kernel/fs/vfs.cpp index 46be3a07a2..31a1da0de5 100644 --- a/src/system/kernel/fs/vfs.cpp +++ b/src/system/kernel/fs/vfs.cpp @@ -1338,7 +1338,7 @@ vnode_path_to_vnode(struct vnode *vnode, char *path, bool traverseLeafLink, int count, struct vnode **_vnode, vnode_id *_parentID, int *_type) { status_t status = 0; - vnode_id lastParentID = -1; + vnode_id lastParentID = vnode->id; int type = 0; FUNCTION(("vnode_path_to_vnode(vnode = %p, path = %s)\n", vnode, path));