!26 [Desc] add debug code to fix bug: kernel crashed after rmdir the umounted folder, parentVnode->data null

Merge pull request !26 from LeonChan/lc-master
This commit is contained in:
openharmony_ci
2021-04-19 11:00:58 +08:00
committed by Gitee
+7
View File
@@ -50,6 +50,8 @@
#include "fs/path_cache.h"
#include "fs/vfs_util.h"
struct Vnode *g_parentOfCoveredVnode = NULL;
/****************************************************************************
* Private Functions
****************************************************************************/
@@ -139,6 +141,11 @@ int do_mkdir(int dirfd, const char *pathname, mode_t mode)
// alloc name cache failed is not a critical problem, let it go.
PRINT_ERR("alloc path cache %s failed\n", dirname);
}
if (!strcmp(dirname, "kernel"))
{
PRINT_ERR("%s-%d: vnode_of_kernel: %p, inode=%p \n", __FUNCTION__, __LINE__, vnode, vnode->data);
g_parentOfCoveredVnode = vnode;
}
parentVnode->useCount--;
VnodeDrop();
out: