]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
repart: switch things over to our own partition reread logic
authorLennart Poettering <lennart@poettering.net>
Mon, 20 Oct 2025 14:13:31 +0000 (16:13 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 22 Oct 2025 20:56:02 +0000 (22:56 +0200)
src/repart/repart.c

index 0af92eea61c8b4ce6feda76165c443e2bfc530cf..1ca825f39dc1425cacdcab95f81a3913296ca497 100644 (file)
@@ -65,6 +65,7 @@
 #include "process-util.h"
 #include "random-util.h"
 #include "ratelimit.h"
+#include "reread-partition-table.h"
 #include "resize-fs.h"
 #include "rm-rf.h"
 #include "set.h"
@@ -7270,12 +7271,8 @@ static int context_write_partition_table(Context *context) {
         else if (capable < 0)
                 return log_error_errno(capable, "Failed to check if block device supports partition scanning: %m");
         else if (capable > 0) {
-                log_info("Telling kernel to reread partition table.");
-
-                if (context->from_scratch)
-                        r = fdisk_reread_partition_table(context->fdisk_context);
-                else
-                        r = fdisk_reread_changes(context->fdisk_context, original_table);
+                log_info("Informing kernel about changed partitions...");
+                r = reread_partition_table_fd(fdisk_get_devfd(context->fdisk_context), /* flags= */ 0);
                 if (r < 0)
                         return log_error_errno(r, "Failed to reread partition table: %m");
         } else