1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-15 09:57:39 +03:00

repart: don't unload data we configured explicitly, and fully free all data we match to disk

The context_unload_partition_table() call is supposed to remove all
data from the loaded partitions about how we mapped it to existing
partitions on disk, but it should leave everything we parsed from the
definition files in place.

We mostly got this right, except for two cases:

1. new_uuid is parsed from the definition files and should stay

2. current_label is read from the existing partition table and should be
   freed
This commit is contained in:
Lennart Poettering 2020-08-11 14:50:36 +02:00
parent 68dd195c1b
commit 15d43e3065

View File

@ -1563,7 +1563,8 @@ static void context_unload_partition_table(Context *context) {
p->padding_area = NULL;
p->allocated_to_area = NULL;
p->current_uuid = p->new_uuid = SD_ID128_NULL;
p->current_uuid = SD_ID128_NULL;
p->current_label = mfree(p->current_label);
}
context->start = UINT64_MAX;