Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No more data blocks available error when writing creates ghost blocks #1

Open
jchenche opened this issue Oct 20, 2019 · 0 comments
Open
Assignees
Labels
invalid This doesn't seem right

Comments

@jchenche
Copy link
Owner

jchenche commented Oct 20, 2019

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.

@jchenche jchenche added the invalid This doesn't seem right label Oct 20, 2019
@jchenche jchenche self-assigned this Oct 20, 2019
@jchenche jchenche pinned this issue Oct 21, 2019
@jchenche jchenche unpinned this issue Oct 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant