mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Suppress move percentage when inactive
This commit is contained in:
parent
23670fbe43
commit
b65b777d2a
@ -336,10 +336,19 @@ int lv_mirror_percent(struct logical_volume *lv, int wait, float *percent,
|
||||
{
|
||||
int r;
|
||||
struct dev_manager *dm;
|
||||
struct lvinfo info;
|
||||
|
||||
if (!activation())
|
||||
return 0;
|
||||
|
||||
if (!lv_info(lv, &info)) {
|
||||
stack;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!info.exists)
|
||||
return 0;
|
||||
|
||||
if (!(dm = dev_manager_create(lv->vg->name, lv->vg->cmd->cft))) {
|
||||
stack;
|
||||
return 0;
|
||||
|
@ -672,16 +672,14 @@ static int _movepercent_disp(struct report_handle *rh, struct field *field,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!(lv->status & PVMOVE)) {
|
||||
if (!(lv->status & PVMOVE) ||
|
||||
!lv_mirror_percent(lv, 0, &move_percent, NULL)) {
|
||||
field->report_string = "";
|
||||
*sortval = UINT64_C(0);
|
||||
field->sort_value = sortval;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Update percentage done in lv metadata in core */
|
||||
lv_mirror_percent(lv, 0, &move_percent, NULL);
|
||||
|
||||
move_percent = pvmove_percent(lv);
|
||||
|
||||
if (!(repstr = pool_zalloc(rh->mem, 8))) {
|
||||
|
Loading…
Reference in New Issue
Block a user