mirror of
https://github.com/openharmony/third_party_NuttX.git
synced 2026-07-01 08:17:34 -04:00
!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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user