You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In writeToFile(), the function returns 0 after getting a "No more data blocks available" error. This doesn't seem right because it doesn't update the size for the data already written to this file. Therefore, those data won't really belong to this file, creating ghost blocks (allocated but not really used).
This is mainly due to the fact that Read and Delete are based on the file size.
Possible fix is to keep track of number of bytes (size) already written to the file. So when the error occurs, I will break the loop instead of returning 0. This way I won't skip the file size update.
The text was updated successfully, but these errors were encountered:
In
writeToFile()
, the function returns 0 after getting a"No more data blocks available"
error. This doesn't seem right because it doesn't update the size for the data already written to this file. Therefore, those data won't really belong to this file, creating ghost blocks (allocated but not really used).This is mainly due to the fact that Read and Delete are based on the file size.
Possible fix is to keep track of number of bytes (size) already written to the file. So when the error occurs, I will break the loop instead of returning 0. This way I won't skip the file size update.
The text was updated successfully, but these errors were encountered: