Recover automatic block number calculation#5
Draft
xOneca wants to merge 6 commits intobestouff:masterfrom
Draft
Conversation
added 4 commits
May 13, 2019 13:41
As it was defined could not work in other contexts (the current lone use works by chance, because multiplication is done first), where the division may yield an unexpected (but valid) zero result.
The total block count was once done automatically but it was lost on commit 457078c. The calculation is recovered, but made optional: it is only done if total blocks is not passed by cmdline. If passed, that value is used and not touched. Also, reserved_frac is taken into account on the automatic calculation.
Must take into account the reserved blocks.
Contributor
Author
|
Although tests pass flawlessly, it seems that there are some blocks that are not being counted in statistics, and thus there aren't enough blocks for some not-so-large folders. |
Owner
|
Could you please add a test demonstrating the problem ? |
Contributor
Author
|
I just I don't say that the flaw is in stats gathering, but I think there must be some blocks that must be taken into account, that aren't. If I remove the |
Add indirect blocks to file block count stats.
bestouff
reviewed
Jun 14, 2020
genext2fs.c
Outdated
| /* Percentage of blocks that are reserved.*/ | ||
| #define RESERVED_BLOCKS 5/100 | ||
| #define MAX_RESERVED_BLOCKS 25/100 | ||
| #define RESERVED_BLOCKS (5/100.) |
Owner
There was a problem hiding this comment.
I'm not fan of introducing floats just for this.
Could you please instead use something like
#define TO_RESERVED_BLOCKS(n) ((n) * 5 / 100)?
Leave the two constants as were defined originally. This reverts the changes made by commit bfc28c7.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Total block count was removed on commit 457078c without explanation. Bring it back with a change: instead of increasing the number of blocks specified by the user (like it used to do), we keep the current behavior of crying to the user.