提交 56050639 编写于 作者: O openharmony_ci 提交者: Gitee

!163 [Desc] add debug code to fix bug: kernel crashed after rmdir the umounted folder 3

Merge pull request !163 from LeonChan/lc-master
......@@ -145,6 +145,7 @@ int VfsJffs2Bind(struct Mount *mnt, struct Vnode *blkDriver, const void *data)
g_jffs2PartList[partNo] = blkDriver;
PRINTK("%s-%d: vnode=%p, inode=%p, i_nlink=%d\n", __FUNCTION__, __LINE__, pv, rootNode, rootNode->i_nlink);
LOS_MuxUnlock(&g_jffs2FsLock);
return 0;
......@@ -231,6 +232,7 @@ int VfsJffs2Lookup(struct Vnode *parentVnode, const char *path, int len, struct
(void)VfsHashInsert(newVnode, node->i_ino);
*ppVnode = newVnode;
PRINTK("%s-%d: vnode=%p, inode=%p, i_nlink=%d path=%s\n", __FUNCTION__, __LINE__, newVnode, node, node->i_nlink, path);
LOS_MuxUnlock(&g_jffs2FsLock);
return 0;
......@@ -269,6 +271,7 @@ int VfsJffs2Create(struct Vnode *parentVnode, const char *path, int mode, struct
(void)VfsHashInsert(newVnode, newNode->i_ino);
*ppVnode = newVnode;
PRINTK("%s-%d: vnode=%p, inode=%p, i_nlink=%d path=%s\n", __FUNCTION__, __LINE__, newVnode, newNode, newNode->i_nlink, path);
LOS_MuxUnlock(&g_jffs2FsLock);
return 0;
......@@ -539,6 +542,7 @@ int VfsJffs2Mkdir(struct Vnode *parentNode, const char *dirName, mode_t mode, st
*ppVnode = newVnode;
(void)VfsHashInsert(newVnode, node->i_ino);
PRINTK("%s-%d: vnode=%p, inode=%p, i_nlink=%d path=%s\n", __FUNCTION__, __LINE__, newVnode, node, node->i_nlink, dirName);
LOS_MuxUnlock(&g_jffs2FsLock);
......
......@@ -165,6 +165,7 @@ int VnodeAlloc(struct VnodeOps *vop, struct Vnode **newVnode)
VnodeDrop();
*newVnode = vnode;
PRINTK("%s-%d: vnode=%p userCount=%d inode=%p\n", __FUNCTION__, __LINE__, vnode, vnode->useCount, vnode->data);
return LOS_OK;
}
......@@ -180,11 +181,11 @@ int VnodeFree(struct Vnode *vnode)
VnodeHold();
for (int i = 0; i < g_coveredVnodeTop; i++) {
if (vnode == g_coveredVnodeList[i]) {
PRINT_ERR("%s-%d: reclaim mounted vnode. vnode=%p userCount=%d inode=%p\n", __FUNCTION__, __LINE__, vnode, vnode->useCount, vnode->data);
PRINTK("%s-%d: reclaim mounted vnode. vnode=%p userCount=%d inode=%p\n", __FUNCTION__, __LINE__, vnode, vnode->useCount, vnode->data);
}
}
if (g_parentOfCoveredVnode == vnode) {
PRINT_ERR("%s-%d: reclaim parent of mounted vnode. vnode=%p userCount=%d inode=%p\n", __FUNCTION__, __LINE__, vnode, vnode->useCount, vnode->data);
PRINTK("%s-%d: reclaim parent of mounted vnode. vnode=%p userCount=%d inode=%p\n", __FUNCTION__, __LINE__, vnode, vnode->useCount, vnode->data);
}
if (vnode->useCount > 0) {
VnodeDrop();
......@@ -204,6 +205,7 @@ int VnodeFree(struct Vnode *vnode)
vnode->vop->Reclaim(vnode);
}
PRINTK("%s-%d: vnode=%p userCount=%d inode=%p\n", __FUNCTION__, __LINE__, vnode, vnode->useCount, vnode->data);
LOS_ListDelete(&vnode->actFreeEntry);
memset_s(vnode, sizeof(struct Vnode), 0, sizeof(struct Vnode));
LOS_ListAdd(&g_vnodeFreeList, &vnode->actFreeEntry);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册