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 reporting disk space to be freed on a pure package removal #1940

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

ppisar
Copy link
Contributor

@ppisar ppisar commented Dec 6, 2024

There was a bug in testing whether a difference of an installation size and a removal size fits into int64_t. E.g. on a pure package removal, the difference was negative, overflowing resulting unsigned type, leading to a very large positive value, larger than could fit into int64_t. As a result an existing range check failed and no report was printed.

This patch fixes it by preventing from a subtraction with a negative rusult.

(A fix which would compute the difference before the branching would either loose precision, or decide the branching twice.)

Resolves: #1938

@kontura
Copy link
Contributor

kontura commented Dec 13, 2024

/packit test

There was a bug in testing whether a difference of an installation size
and a removal size fits into int64_t. E.g. on a pure package removal,
the difference was negative, overflowing resulting unsigned type,
leading to a very large positive value, larger than could fit into
int64_t. As a result an existing range check failed and no report was
printed.

This patch fixes it by preventing from a subtraction with a negative
rusult.

(A fix which would compute the difference before the branching
would either loose precision, or decide the branching twice.)

Resolves: rpm-software-management#1938
@ppisar
Copy link
Contributor Author

ppisar commented Dec 16, 2024

I rebased this pull request to the current main HEAD.

@ppisar
Copy link
Contributor Author

ppisar commented Dec 16, 2024

@kontura, after a rebase, all tests pass.

@kontura kontura self-assigned this Dec 16, 2024
@kontura
Copy link
Contributor

kontura commented Dec 16, 2024

Thank you

@kontura kontura added this pull request to the merge queue Dec 16, 2024
Merged via the queue into rpm-software-management:main with commit b533df5 Dec 16, 2024
17 checks passed
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.

dnf remove doesn't show total space freed
2 participants