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

Fix infinite loop enlarging the refcount table #9

Merged
merged 3 commits into from Nov 9, 2015

Conversation

djs55
Copy link
Member

@djs55 djs55 commented Nov 9, 2015

  • Fix an infinite loop when enlarging the refcount table
  • add CLI commands read and write

The function `max_refcount_table_size` will return a size suitable for
refcounting the data blocks, but not the refcount blocks (recall that
the refcount table entries point to clusters which contain the reference
counts). It will also fail to take into consideration the fact that the
file may legitimately have holes in.

This patch fixes an infinite loop caused when re-allocating the refcount
table _to the same size it already is_ by guaranteeing that the table
will be doubled in size in this case.

This is related to mirage#8

Signed-off-by: David Scott <dave.scott@unikernel.com>
Signed-off-by: David Scott <dave.scott@unikernel.com>
This is intended to let you read small amounts of data at a time (e.g.
up to a few KiB)

Signed-off-by: David Scott <dave.scott@unikernel.com>
djs55 added a commit that referenced this pull request Nov 9, 2015
Fix infinite loop enlarging the refcount table
@djs55 djs55 merged commit ed768ad into mirage:master Nov 9, 2015
@djs55 djs55 deleted the add-boundary-tests branch November 9, 2015 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant