1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

snapshot: for invalid snapshot show 100%

Recent commit 92eba53a79 started to report
empty "" data usage of invalid snapshot, restore 100% to be shown.
This commit is contained in:
Zdenek Kabelac 2016-05-27 17:16:14 +02:00
parent 43dfc2011c
commit 88eeb004e9

View File

@ -380,8 +380,10 @@ dm_percent_t lvseg_percent_with_info_and_seg_status(const struct lv_with_info_an
}
break;
case SEG_STATUS_SNAPSHOT:
if (s->snapshot->invalid || s->snapshot->merge_failed)
if (s->snapshot->merge_failed)
p = DM_PERCENT_INVALID;
else if (s->snapshot->invalid)
p = DM_PERCENT_100; /* Shown as 100% full */
else if (s->snapshot->has_metadata_sectors &&
(s->snapshot->used_sectors == s->snapshot->metadata_sectors))
p = DM_PERCENT_0;