Index: parted-2.2/libparted/arch/gnu.c
===================================================================
--- parted-2.2.orig/libparted/arch/gnu.c	2010-02-08 07:48:18.000000000 +0100
+++ parted-2.2/libparted/arch/gnu.c	2010-06-21 17:21:11.000000000 +0200
@@ -185,7 +185,7 @@
 	if (!dev->arch_specific)
 		goto error_free_path;
 
-	dev->type = PED_DEVICE_FILE;	/* FIXME? */
+	dev->type = PED_DEVICE_UNKNOWN; /* it's deprecated anyway */
 	dev->open_count = 0;
 	dev->read_only = 0;
 	dev->external_mode = 0;
@@ -204,10 +204,39 @@
 	return NULL;
 }
 
+/* Ask the kernel to reload the partition table.  XXX: Will probably be
+   replaced by some RPC to partfs when it's finished.  In the meantime,
+   gnumach's glue layer will pass BLKRRPART to the Linux drivers.
+   See also _kernel_reread_part_table() in linux.c.  */
+#define BLKRRPART 0x125F
 static int
 _kernel_reread_part_table (PedDevice* dev)
 {
-	/* XXX: We must wait for partfs to be finished.  */
+	struct store *store = GNU_SPECIFIC (dev)->store;
+	int retry_count = 9;
+
+	if(strcmp(store->class->name, "device") != 0)
+		return 1;
+
+	sync();
+	while (device_set_status (store->port, BLKRRPART, NULL, 0)) {
+		retry_count--;
+		sync();
+		if (retry_count == 3)
+			sleep(1); /* Pause to allow system to settle */
+
+		if (!retry_count) {
+			ped_exception_throw (
+				PED_EXCEPTION_WARNING,
+				PED_EXCEPTION_IGNORE,
+			_("WARNING: the kernel failed to re-read the partition "
+			  "table on %s (%s).  As a result, it may not "
+			  "reflect all of your changes until after reboot."),
+				dev->path, strerror (errno));
+			return 0;
+		}
+	}
+
 	return 1;
 }
 
@@ -845,7 +874,7 @@
 	result = (char*) ped_malloc (result_len);
 	if (!result)
 		return NULL;
-	snprintf (result, result_len, "%s%d", dev_path, part->num);
+	snprintf (result, result_len, "%ss%d", dev_path, part->num);
 	return result;
 }
 
@@ -858,7 +887,7 @@
 static int
 gnu_disk_commit (PedDisk* disk)
 {
-	return 1;
+	return _kernel_reread_part_table (disk->dev);
 }
 
 static PedDeviceArchOps gnu_dev_ops = {
