mirror of
https://github.com/systemd/systemd.git
synced 2025-03-31 14:50:15 +03:00
repart: use real disk start/end for bar production
Partitions are not always within our aligned scope. Bar printing involves foreign partitions as well. Fixes #21817.
This commit is contained in:
parent
21747dcd3b
commit
d8daed09f3
@ -2080,16 +2080,14 @@ static void context_bar_char_process_partition(
|
||||
from = p->offset;
|
||||
to = from + p->new_size;
|
||||
|
||||
assert(context->end >= context->start);
|
||||
total = context->end - context->start;
|
||||
assert(context->total > 0);
|
||||
total = context->total;
|
||||
|
||||
assert(from >= context->start);
|
||||
assert(from <= context->end);
|
||||
x = (from - context->start) * n / total;
|
||||
assert(from <= total);
|
||||
x = from * n / total;
|
||||
|
||||
assert(to >= context->start);
|
||||
assert(to <= context->end);
|
||||
y = (to - context->start) * n / total;
|
||||
assert(to <= total);
|
||||
y = to * n / total;
|
||||
|
||||
assert(x <= y);
|
||||
assert(y <= n);
|
||||
|
Loading…
x
Reference in New Issue
Block a user