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

Merge pull request !10 from LeonChan/lc-master
This commit is contained in:
openharmony_ci
2021-04-16 15:14:28 +08:00
committed by Gitee
2 changed files with 11 additions and 0 deletions
+3
View File
@@ -243,6 +243,9 @@ int jffs2_rmdir (struct jffs2_inode *dir_i, struct jffs2_inode *d_inode, const u
int ret;
uint32_t now = Jffs2CurSec();
if (c == NULL) {
PRINT_ERR("%s-%d: sb_info null. sb=%p, inode=%p, vnode=%p\n", __FUNCTION__, __LINE__, dir_i->i_sb, dir_i, dir_i->i_vnode);
}
for (fd = f->dents ; fd; fd = fd->next) {
if (fd->ino) {
PRINT_ERR("%s-%d: ret=%d\n", __FUNCTION__, __LINE__, ENOTEMPTY);
+8
View File
@@ -262,6 +262,8 @@ struct jffs2_inode *jffs2_iget(struct super_block *sb, uint32_t ino)
return inode;
}
extern int g_coveredVnodeTop;
extern struct Vnode *g_coveredVnodeList[100];
// -------------------------------------------------------------------------
// Decrement the reference count on an inode. If this makes the ref count
@@ -275,6 +277,12 @@ int jffs2_iput(struct jffs2_inode *i)
// and gc.c jffs2_garbage_collect_pass
struct jffs2_inode_info *f = NULL;
for (int p = 0; p < g_coveredVnodeTop; p++) {
if (i->i_vnode == g_coveredVnodeList[p]) {
PRINT_ERR("%s-%d: jffs2_iput mounted vnode. vnode=%p, inode=%p, i->i_nlink=%d\n", __FUNCTION__, __LINE__, i->i_vnode, i, i->i_nlink);
}
}
Jffs2NodeLock();
if (!i || i->i_nlink) {
// and let it fault...