Hans de Goede wrote: > I think the comment about devfs can and should be removed too, esp. > as we no longer test for devfs (and fallback to the reread ioctl in > case of devfs).
Thanks. That is definitely a stale comment. I've squashed that in: >From 9fa0e1800db5b9f094ae481fd95a51da03f19e95 Mon Sep 17 00:00:00 2001 From: Brian C. Lane <b...@redhat.com> Date: Mon, 22 Nov 2010 10:01:56 +0100 Subject: [PATCH 1/4] linux: remove DASD restriction on _disk_sync_part_table * libparted/arch/linux.c: Include <assert.h>. (linux_disk_commit): Assert that _have_blkpg returns true and don't skip _disk_sync_part_table for DASD devices. Otherwise, when creating a partition on a DASD device, new /dev/*[12...] device files would not be created. Also, remove obsolete comment about DevFS. For details, see http://bugzilla.redhat.com/651478 and http://thread.gmane.org/gmane.comp.gnu.parted.bugs/10191 --- libparted/arch/linux.c | 22 +++++++++------------- 1 files changed, 9 insertions(+), 13 deletions(-) diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c index a5ae10c..4e61bfe 100644 --- a/libparted/arch/linux.c +++ b/libparted/arch/linux.c @@ -40,6 +40,7 @@ #include <sys/types.h> #include <sys/utsname.h> /* for uname() */ #include <scsi/scsi.h> +#include <assert.h> #ifdef ENABLE_DEVICE_MAPPER #include <libdevmapper.h> #endif @@ -2824,20 +2825,15 @@ linux_disk_commit (PedDisk* disk) return _dm_reread_part_table (disk); #endif if (disk->dev->type != PED_DEVICE_FILE) { - /* The ioctl() command BLKPG_ADD_PARTITION does not notify - * the devfs system; consequently, /proc/partitions will not - * be up to date, and the proper links in /dev are not - * created. Therefore, if using DevFS, we must get the kernel - * to re-read and grok the partition table. - */ - /* Work around kernel dasd problem so we really do BLKRRPART */ - int ok = 1; - if (disk->dev->type != PED_DEVICE_DASD && _have_blkpg ()) { - if (!_disk_sync_part_table (disk)) - ok = 0; - } - return ok; + /* We now require BLKPG support. If this assertion fails, + please write to the mailing list describing your system. + Assuming it's never triggered, ... + FIXME: remove this assertion in 2012. */ + assert (_have_blkpg ()); + + if (!_disk_sync_part_table (disk)) + return 0; } return 1; -- 1.7.3.2.765.g642a8 _______________________________________________ bug-parted mailing list bug-parted@gnu.org http://lists.gnu.org/mailman/listinfo/bug-parted