提交 902a11de 编写于 作者: F Far

fix: lookup new vnode may cause parent vnode freeing

Close #I3MYP4

Change-Id: I533f4bacaf7e6dd500f5ac3ce4f5343b3b885988
上级 7ba0bfa8
...@@ -398,6 +398,7 @@ static int Step(char **currentDir, struct Vnode **currentVnode, uint32_t flags) ...@@ -398,6 +398,7 @@ static int Step(char **currentDir, struct Vnode **currentVnode, uint32_t flags)
goto STEP_FINISH; goto STEP_FINISH;
} }
(*currentVnode)->useCount++;
if (flags & V_DUMMY) { if (flags & V_DUMMY) {
ret = ProcessVirtualVnode(*currentVnode, flags, &nextVnode); ret = ProcessVirtualVnode(*currentVnode, flags, &nextVnode);
} else { } else {
...@@ -407,6 +408,7 @@ static int Step(char **currentDir, struct Vnode **currentVnode, uint32_t flags) ...@@ -407,6 +408,7 @@ static int Step(char **currentDir, struct Vnode **currentVnode, uint32_t flags)
ret = -ENOSYS; ret = -ENOSYS;
} }
} }
(*currentVnode)->useCount--;
if (ret == LOS_OK) { if (ret == LOS_OK) {
(void)PathCacheAlloc((*currentVnode), nextVnode, nextDir, len); (void)PathCacheAlloc((*currentVnode), nextVnode, nextDir, len);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册