From b9d22b21e8a0f4222a0fa339c96c9a2ba8fd095e Mon Sep 17 00:00:00 2001 From: chenwei Date: Sat, 27 Mar 2021 09:54:19 +0800 Subject: [PATCH] [Desc] 1, remove redundant code for O_APPEND flag in VfsJffs2Write; 2, fix bug for access freed memory in VfsJffs2Reclaim Change-Id: Ibf8a1f352afa0c7ae608431a756ee58cec9bc262 --- fs/jffs2/src/vfs_jffs2.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/fs/jffs2/src/vfs_jffs2.c b/fs/jffs2/src/vfs_jffs2.c index f82f9c5f..e74b2c85 100755 --- a/fs/jffs2/src/vfs_jffs2.c +++ b/fs/jffs2/src/vfs_jffs2.c @@ -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); -- GitLab