Yang Zhang created a merge request: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1346

Project:Branches: Chloe/rtems:fix-dosfs-write-cache to rtems/rtos/rtems:main
Author:   Yang Zhang



## Summary

In fat_file_write_fat32_or_non_root_dir(), the FAT file cache was updated even 
if the first fat_cluster_write() failed and no bytes were completed.

\
In that case, cmpltd remains zero, so the expression using cmpltd - 1 may 
underflow and the cache may be updated with an invalid file cluster or disk 
cluster mapping.

Only update the cache if at least one byte was successfully written.

## Generative AI

<!--If you have used AI please use the "AI Contribution" template otherwise 
leave this blank see our fulls statement at 
https://www.rtems.org/generative-ai/-->

None

<!--Default settings, if it is a dropdown it will set after submission-->

-- 
View it on GitLab: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1346
You're receiving this email because of your account on gitlab.rtems.org. 
Unsubscribe from this thread: 
https://gitlab.rtems.org/-/sent_notifications/4-brsunbpfj2xemftfn9cbh5gzh-1d/unsubscribe
 | Manage all notifications: https://gitlab.rtems.org/-/profile/notifications | 
Help: https://gitlab.rtems.org/help


_______________________________________________
bugs mailing list
[email protected]
http://lists.rtems.org/mailman/listinfo/bugs

Reply via email to