repart: don't insist on coming up on partition label ourselves

If the user specified a label, use that.

Fixes: #15841
This commit is contained in:
Lennart Poettering 2020-05-19 09:23:00 +02:00 committed by Zbigniew Jędrzejewski-Szmek
parent 44dcb318cc
commit feb13fca97
1 changed files with 3 additions and 1 deletions

View File

@ -2233,7 +2233,6 @@ static int context_acquire_partition_uuids_and_labels(Context *context) {
LIST_FOREACH(partitions, p, context->partitions) {
assert(sd_id128_is_null(p->new_uuid));
assert(!p->new_label);
/* Never touch foreign partitions */
if (PARTITION_IS_FOREIGN(p)) {
@ -2256,6 +2255,9 @@ static int context_acquire_partition_uuids_and_labels(Context *context) {
return r;
}
if (p->new_label) /* Explicitly set by user? */
continue;
if (!isempty(p->current_label)) {
p->new_label = strdup(p->current_label); /* never change initialized labels */
if (!p->new_label)