!99 [Desc] 1, remove redundant code for O_APPEND flag in VfsJffs2Write; 2, fix bug for access freed memory in VfsJffs2Reclaim

Merge pull request !99 from LeonChan/master
This commit is contained in:
openharmony_ci 2021-03-27 15:29:32 +08:00 committed by Gitee
commit 1763f37811
1 changed files with 1 additions and 5 deletions

View File

@ -336,10 +336,6 @@ ssize_t VfsJffs2Write(struct file *filep, const char *buffer, size_t bufLen)
}
}
#endif
// If the APPEND mode bit was supplied, force all writes to
// the end of the file.
if (filep->f_oflags & O_APPEND)
pos = node->i_size;
if (pos < 0) {
LOS_MuxUnlock(&g_jffs2FsLock);
return -EINVAL;
@ -714,8 +710,8 @@ int VfsJffs2Reclaim(struct Vnode *pVnode)
return LOS_OK;
}
ret = jffs2_iput(node);
node->i_vnode = NULL;
ret = jffs2_iput(node);
LOS_MuxUnlock(&g_jffs2FsLock);