提交 9d19f96a 编写于 作者: F Far

fix: parent field of vnode found by VfsHashGet should be updated

When tmpfs_lookup find a vnode from hashlist, the field parent of vnode should be updated,
because the old parent may be reclaimed.

Close #I3NNFA
上级 45391fc3
......@@ -1802,7 +1802,6 @@ int tmpfs_lookup(struct Vnode *parent, const char *relPath, int len, struct Vnod
goto errout_with_objects;
}
vp->parent = parent;
vp->vop = parent->vop;
vp->fop = parent->fop;
vp->data = to;
......@@ -1814,6 +1813,7 @@ int tmpfs_lookup(struct Vnode *parent, const char *relPath, int len, struct Vnod
ret = VfsHashInsert(vp, (uint32_t)to);
}
vp->parent = parent;
*vpp = vp;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册