From f32caa52c67eca20d58676be4e0439acbb4c5ac3 Mon Sep 17 00:00:00 2001 From: Far Date: Thu, 22 Apr 2021 16:24:08 +0800 Subject: [PATCH] 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 --- fs/fat/os_adapt/fatfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/fat/os_adapt/fatfs.c b/fs/fat/os_adapt/fatfs.c index 0ff14a06..de0ab68b 100644 --- a/fs/fat/os_adapt/fatfs.c +++ b/fs/fat/os_adapt/fatfs.c @@ -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 */ }