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

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

Close #I3NNFA
This commit is contained in:
Far 2021-04-22 16:24:08 +08:00
parent 6ee33eb893
commit f32caa52c6
1 changed files with 1 additions and 0 deletions

View File

@ -300,6 +300,7 @@ int fatfs_lookup(struct Vnode *parent, const char *path, int len, struct Vnode *
goto ERROR_UNLOCK;
}
} else {
vp->parent = parent;
free(dfp); /* hash hit dfp is no needed */
}