summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/udiskslinuxpartitiontable.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/udiskslinuxpartitiontable.c b/src/udiskslinuxpartitiontable.c
index 2692b31..7870ca8 100644
--- a/src/udiskslinuxpartitiontable.c
+++ b/src/udiskslinuxpartitiontable.c
@@ -343,6 +343,7 @@ handle_create_partition (UDisksPartitionTable *table,
uid_t caller_uid;
gid_t caller_gid;
gboolean do_wipe = TRUE;
+ gboolean was_partitioned = FALSE;
GError *error;
error = NULL;
@@ -589,6 +590,10 @@ handle_create_partition (UDisksPartitionTable *table,
/* this is sometimes needed because parted(8) does not generate the uevent itself */
udisks_linux_block_object_trigger_uevent (UDISKS_LINUX_BLOCK_OBJECT (object));
+ was_partitioned = (udisks_object_peek_partition_table (object) != NULL);
+ if (was_partitioned)
+ udisks_linux_block_object_reread_partition_table (UDISKS_LINUX_BLOCK_OBJECT (object));
+
/* sit and wait for the partition to show up */
g_warn_if_fail (wait_data->pos_to_wait_for > 0);
wait_data->partition_table_object = object;
@@ -644,6 +649,8 @@ handle_create_partition (UDisksPartitionTable *table,
/* this is sometimes needed because parted(8) does not generate the uevent itself */
udisks_linux_block_object_trigger_uevent (UDISKS_LINUX_BLOCK_OBJECT (partition_object));
+ if (was_partitioned)
+ udisks_linux_block_object_reread_partition_table (UDISKS_LINUX_BLOCK_OBJECT (object));
udisks_partition_table_complete_create_partition (table,
invocation,