]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
repart: don't insist on coming up on partition label ourselves
authorLennart Poettering <lennart@poettering.net>
Tue, 19 May 2020 07:23:00 +0000 (09:23 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 19 May 2020 13:04:01 +0000 (15:04 +0200)
If the user specified a label, use that.

Fixes: #15841
src/partition/repart.c

index 4c738920abcb1fbae0979a7a6bf7ffc888f06274..46e82eaf90a360c6d46e21a39c60c2d63c225472 100644 (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)