You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/01/18 04:32:16 UTC
[GitHub] [incubator-nuttx] SPRESENSE opened a new pull request #5257: fs/smartfs: Fix file size corruption when opening with truncate mode
SPRESENSE opened a new pull request #5257:
URL: https://github.com/apache/incubator-nuttx/pull/5257
## Summary
If a existing file is opened with truncate mode e.g. fopen(file, "w+"),
the file size will be incorrect after writing any data to the file.
Before writing to the first sector, the reading is performed again.
As a result, it makes an invalid file size. When a sector buffer is used,
it must also write to the first sector.
The previous commit is wrong, so it is reverted, and a new commit is added.
## Impact
SmartFS when CONFIG_SMARTFS_USE_SECTOR_BUFFER is enabled
## Testing
Use spresense:usbnsh defconfig which enables SmartFS and CONFIG_SMARTFS_USE_SECTOR_BUFFER.
Test that appending to an existing file that is less than one sector will not break the file.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] jerpelea merged pull request #5257: fs/smartfs: Fix file size corruption when opening with truncate mode
Posted by GitBox <gi...@apache.org>.
jerpelea merged pull request #5257:
URL: https://github.com/apache/incubator-nuttx/pull/5257
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org