From 60913d3b69ff6343bcf837f96ae7ed3da590403f Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Tue, 18 Jan 2022 12:56:36 +0900 Subject: [PATCH] Revert "fs/smartfs: Fix file size corruption when opening with overwriting mode" This reverts commit 89a79b03cfcdd07a11b799fd4612e57d35d659f7. --- fs/smartfs/smartfs_smart.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/smartfs/smartfs_smart.c b/fs/smartfs/smartfs_smart.c index c58cee54f5..d2fb7b9fa6 100644 --- a/fs/smartfs/smartfs_smart.c +++ b/fs/smartfs/smartfs_smart.c @@ -318,11 +318,10 @@ static int smartfs_open(FAR struct file *filep, const char *relpath, /* When using sector buffering, current sector with its header should * always be present in sf->buffer. Otherwise data corruption may arise - * when writing. However, this does not apply when overwriting without - * append mode. + * when writing. */ - if ((sf->currsector != SMARTFS_ERASEDSTATE_16BIT) && (oflags & O_APPEND)) + if (sf->currsector != SMARTFS_ERASEDSTATE_16BIT) { readwrite.logsector = sf->currsector; readwrite.offset = 0;