!162 fix: lookup new vnode may cause parent vnode freeing
Merge pull request !162 from Far/dev
This commit is contained in:
commit
ef4341acea
|
@ -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)
|
||||||
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);
|
||||||
|
|
Loading…
Reference in New Issue