From: Brian C. Lane Date: Mon, 22 Nov 2010 09:01:56 +0000 (+0100) Subject: linux: remove DASD restriction on _disk_sync_part_table X-Git-Tag: android-x86-4.4-r1~253 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=9fa0e1800db5b9f094ae481fd95a51da03f19e95;p=android-x86%2Fexternal-parted.git linux: remove DASD restriction on _disk_sync_part_table * libparted/arch/linux.c: Include . (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 --- 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 #include /* for uname() */ #include +#include #ifdef ENABLE_DEVICE_MAPPER #include #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;