yushuailong commented on PR #21462:
URL: https://github.com/apache/nuttx/pull/21462#issuecomment-6660136300

   > `fat_open()` with O_TRUNC (fs_fat32.c:558) still truncates the on-disk 
start cluster, the stale case this PR fixes in `fat_truncate()`. Create and 
write 3 clusters on fd1 with no sync, then open(O_WRONLY | O_TRUNC) on fd2: the 
free count drops by 3 and the raw FAT has 3 lost clusters.
   > 
   > Fix: when the file is already open, put `s_startcluster` into `direntry` 
before `fat_dirtruncate()`, as `fat_truncate()` does now.
   > 
   > The Testing section logs only sim:ostest, which does not mount FAT. The 
commit message cites 327 RAM-disk checks, but the test and its log are not in 
the PR.
   > 
   > Fix: add the test program or a link to it, and its log, to the PR body.
   
   Done, the relevant tests have been added.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to