Re: [PATCH] Remove DASD restriction on _disk_sync_part_table (#651478)

2010-11-22 Thread Hans de Goede
Hi, 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). Regards, Hans On 11/22/2010 10:04 AM, Jim Meyering wrote: Brian C. Lane wrote: --- libparted/arch/linux.c | 23 ++-

[PATCH parted] linux: recognize scsi disks with a high major (128-135)

2010-07-20 Thread Hans de Goede
libparted/arch/linux.c(SCSI_BLK_MAJOR): recognize high majors --- NEWS |2 ++ libparted/arch/linux.c | 11 ++- 2 files changed, 12 insertions(+), 1 deletions(-) diff --git a/NEWS b/NEWS index 45bd2bf..a1863fc 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,8 @@ GNU parted

[PATCH parted 2/2] gpt: recognize microsoft recovery GUID

2010-05-06 Thread Hans de Goede
Microsoft advices creating recovery partitions with a GUID of de94bba4-06d1-4d40-a16a-bfd50179d6ac, see: http://technet.microsoft.com/en-us/library/dd744301%28WS.10%29.aspx This patch makes parted recognize this guid (using the DIAG flag). * libparted/labels/gpt.c(PARTITION_MSFT_RECOVERY, GPTParti

[PATCH parted 1/2] msdos: recognize id 27 as a diagnostics (recovery) partition

2010-05-06 Thread Hans de Goede
msdos partitiontable partition id 27 is recommended by microsoft for use as id for recovery partitions, see: http://technet.microsoft.com/en-us/library/dd744364%28WS.10%29.aspx http://bugzilla.redhat.com/show_bug.cgi?id=534066 * libparted/labels/dos.c(PARTITION_MSFT_RECOVERY): add define * libpart

Re: [PATCH] tests: test all boolean flags

2010-04-28 Thread Hans de Goede
0-flags.sh: New test, suggested by Hans De Goede. * tests/Makefile.am (TESTS): Add it. --- tests/Makefile.am|1 + tests/t3310-flags.sh | 68 ++ 2 files changed, 69 insertions(+), 0 deletions(-) create mode 100644 tests/t3310-flags.sh

[PATCH parted 2/2] _device_unregister: check for unregistering the same device twice

2010-04-28 Thread Hans de Goede
_device_unregister() can get called 2 times for the same device if a libparted user explictly removes the device from the cache using ped_device_cache_remove(), it gets called and it then becomes the user's responsibility to free the PedDevice by calling ped_device_destroy(). ped_device_destroy() w

[PATCH parted 1/2] dos: Add a partition flag for diagnostics / recovery partitions

2010-04-28 Thread Hans de Goede
msdos partition tables can contain diagnostics partitions (often used now a days as system recovery partitions). For some users of libparted (ie anaconda) it is usefull to know if a dos partition is a regular partition or a diagnostic partition (see rh bug 534066). * include/parted/disk.h(_PedPart

[PATCH parted] linux: dm_task_run returns 0 on error

2010-04-23 Thread Hans de Goede
We were checking for a return value of < 0 for dm_task_run errors, but dm_task_run returns 0 on error (and 1 on success). Thanks to Joe Jin for spotting this, see Red Hat bug 582907. * libparted/arch/linux.c(_dm_remove_map_name, _dm_is_part, _dm_remove_parts, _dm_add_partition): dm_task_run return

Re: [PATCH parted 1/2] dos: Add a partition flag for diagnostics / recovery partitions

2010-04-21 Thread Hans de Goede
Hi, On 04/20/2010 08:38 PM, Jim Meyering wrote: Hans de Goede wrote: msdos partition tables can contain diagnostics partitions (often used now a days as system recovery partitions). For some users of libparted (ie anaconda) it is usefull to know if a dos partition is a regular partition or a

[PATCH parted 2/2] dos: Fix prep / palo flag handling

2010-04-19 Thread Hans de Goede
Setting the prep flag was not clearing the palo flag and vica versa * libparted/labels/dos.c(msdos_partition_set_flag): Fix prep / palo flag handling. --- libparted/labels/dos.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/libparted/labels/dos.c b/libparted/labels/dos.

[PATCH parted 1/2] dos: Add a partition flag for diagnostics / recovery partitions

2010-04-19 Thread Hans de Goede
msdos partition tables can contain diagnostics partitions (often used now a days as system recovery partitions). For some users of libparted (ie anaconda) it is usefull to know if a dos partition is a regular partition or a diagnostic partition (see rh bug 534066). * include/parted/disk.h(_PedPart

[PATCH parted 2/2] libparted: Don't canonicalize /dev/mapper paths

2010-04-06 Thread Hans de Goede
Besides fixing the issue displayed by libparted/tests/symlink.c, this has the added advantage that the output of parted p on one of these devices now says: "Disk /dev/mapper/BigVol2-lv_iscsi_disk2: 34.4GB" Which is a lot more user friendly then the output before this patch: "Disk /dev/dm-6: 34.4GB

[PATCH parted 1/2] libparted: Add test for /dev/mapper symlink issue

2010-04-06 Thread Hans de Goede
Sometimes libparted operates on device mapper files, with a path of /dev/mapper/foo. With newer lvm versions /dev/mapper/foo is a symlink to /dev/dm-#. However some storage administration programs (anaconda for example) may do the following: 1) Create a ped_device for /dev/mapper/foo 2) ped_get_dev

[PATCH parted] msdos_partition_is_flag_available: fix hidden on extended

2010-03-02 Thread Hans de Goede
From: David Cantrell Since the hidden flag cannot be set on extended partitions, msdos_partition_is_flag_available() should return 0 for hidden on extended partitions. Also change msdos_partition_get_flag() to always return 0 for hidden on extended partitions. * libparted/labels/dos.c (msdos_part

[PATCH parted] libparted: copy needs_clobber value in ped_disk_duplicate()

2010-02-18 Thread Hans de Goede
Most duplicate disk_ops use ped_disk_new_fresh, which sets needs_clobber to 1. This would lead to clobbering the disk when committing a duplicate disk even when the original disk was not made with ped_disk_new_fresh. * libparted/disk.c (ped_disk_duplicate): copy needs_clobber value. --- libparted/

[PATCH parted 2/7] libparted: Give device_get_*_alignment sane defaults

2010-02-10 Thread Hans de Goede
When the topology info is incomplete or non existent, return something more sensible then NULL (which ends up being interpreted as PedAlignmentAny in most cases). The default minimum alignment aligns to physical sector size, the default optimal alignment is 1 MiB, which is what vista and windows 7

[PATCH parted 5/7] parted: change warnings when initial constrained mkpart fails

2010-02-10 Thread Hans de Goede
In do_mkpart we first try to create a partition using a constraint derived from the user input intersected with the devices alignment needs. And if that fails we try again without any constraint. However the warning given when this happens only takes into account the user not getting what he asked

[PATCH parted 7/7] dasd: Fix NULL pointer dereference in dasd_read

2010-02-10 Thread Hans de Goede
* libparted/labels/dasd.c (dasd_read): Fix NULL ptr dereference. --- libparted/labels/dasd.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/libparted/labels/dasd.c b/libparted/labels/dasd.c index 4b5840b..516d189 100644 --- a/libparted/labels/dasd.c +++ b/libparted/label

[PATCH parted 4/7] parted: Honor --align option also in mkpartfs, resize and print cmds

2010-02-10 Thread Hans de Goede
parted/parted.c (do_mkpartfs,do_print,do_resize): honor --align --- parted/parted.c | 26 +- 1 files changed, 25 insertions(+), 1 deletions(-) diff --git a/parted/parted.c b/parted/parted.c index 06b9f6c..69451a8 100644 --- a/parted/parted.c +++ b/parted/parted.c @@ -949

[PATCH parted 6/7] parted: Change default alignment to optimal

2010-02-10 Thread Hans de Goede
parted/parted.c: change --align default value to optimal tests/*.sh: adjust for alignment changes where necessary --- NEWS |3 +++ parted/parted.c|2 +- tests/t0220-gpt-msftres.sh |4 ++-- tests/t0280-gpt

[PATCH parted 3/7] linux: handle incomplete topology information

2010-02-10 Thread Hans de Goede
The topology information returned by libblkid is not always complete (as the kernel does not always have complete information). This patch makes the linux_get_*_alignment() alignment functions handle this. The algorithm used for linux_get_optimum_alignment is: 1) Always use the reported aligment of

[PATCH parted 1/7] linux: Fixup phys_sector_size setting

2010-02-10 Thread Hans de Goede
1) Use the logical sector size as physical sector size instead of 512 when not compiled with libblkid support, this fixes problems with logical sector size > physical sector size. 2) blkid_topology_get_physical_sector_size() can return 0 when it could not determine the physical sector size

Re: [PATCH parted 6/7] Makefiles: Fix check-other-sector_sizes

2010-01-31 Thread Hans de Goede
Hi, On 01/31/2010 05:14 PM, Jim Meyering wrote: Hans de Goede wrote: Thanks for the heads up, note that I've finished a couple of test installs this morning and the rest of the patch set is good to go too from my pov. Actually I've already build Fedora and RHEL-6 packages

Re: [PATCH parted 6/7] Makefiles: Fix check-other-sector_sizes

2010-01-31 Thread Hans de Goede
Hi, Thanks for the heads up, note that I've finished a couple of test installs this morning and the rest of the patch set is good to go too from my pov. Actually I've already build Fedora and RHEL-6 packages with it in. Regards, Hans On 01/31/2010 03:55 PM, Jim Meyering wrote

[PATCH parted 7/7] parted: Change default alignment to optimal

2010-01-30 Thread Hans de Goede
parted/parted.c: change --align default value to optimal tests/*.sh: adjust for alignment changes where necessary --- NEWS |3 +++ parted/parted.c|2 +- tests/t0220-gpt-msftres.sh |4 ++-- tests/t0280-gpt

[PATCH parted 2/7] libparted: Give device_get_*_alignment sane defaults

2010-01-30 Thread Hans de Goede
When the topology info is incomplete or non existent, return something more sensible then NULL (which ends up being interpreted as PedAlignmentAny in most cases). The default minimum alignment aligns to physical sector size, the default optimal alignment is 1 MiB, which is what vista and windows 7

[PATCH parted 3/7] linux: handle incomplete topology information

2010-01-30 Thread Hans de Goede
The topology information returned by libblkid is not always complete (as the kernel does not always have complete information). This patch makes the linux_get_*_alignment() alignment functions handle this. The algorithm used for linux_get_optimum_alignment is: 1) Always use the reported aligment of

[PATCH parted 4/7] parted: Honor --align option also in mkpartfs, resize and print cmds

2010-01-30 Thread Hans de Goede
parted/parted.c (do_mkpartfs,do_print,do_resize): honor --align --- parted/parted.c | 26 +- 1 files changed, 25 insertions(+), 1 deletions(-) diff --git a/parted/parted.c b/parted/parted.c index c4d1779..5ba8bbf 100644 --- a/parted/parted.c +++ b/parted/parted.c @@ -949

[PATCH parted 6/7] Makefiles: Fix check-other-sector_sizes

2010-01-30 Thread Hans de Goede
Atleast on my system check-other-sector_sizes was actually just testing 512 bytes sectors 4 times. This fixes this. * Makefile.am: Fix check-other-sector_sizes --- Makefile.am |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Makefile.am b/Makefile.am index 0e80967..d5a32ef

[PATCH parted 5/7] parted: change warnings when initial constrained mkpart fails

2010-01-30 Thread Hans de Goede
In do_mkpart we first try to create a partition using a constraint derived from the user input intersected with the devices alignment needs. And if that fails we try again without any constraint. However the warning given when this happens only takes into account the user not getting what he asked

[PATCH parted 1/7] linux: Fixup phys_sector_size setting

2010-01-30 Thread Hans de Goede
1) Use the logical sector size as physical sector size instead of 512 when not compiled with libblkid support, this fixes problems with logical sector size > physical sector size. 2) blkid_topology_get_physical_sector_size() can return 0 when it could not determine the physical sector size

Re: [PATCH parted 3/3] linux: Remove PED_DEVICE_FILE check from _device_set_sector_size

2010-01-29 Thread Hans de Goede
Hi, On 01/29/2010 10:31 AM, Jim Meyering wrote: Hans de Goede wrote: _device_set_sector_size never get called for devices with a type of PED_DEVICE_FILE, and having a PED_DEVICE_FILE check inside an ifdef __390__ block does not make sense. * libparted/arch/linux.c(_device_set_sector_size

[PATCH parted 3/3] linux: Remove PED_DEVICE_FILE check from _device_set_sector_size

2010-01-11 Thread Hans de Goede
_device_set_sector_size never get called for devices with a type of PED_DEVICE_FILE, and having a PED_DEVICE_FILE check inside an ifdef __390__ block does not make sense. * libparted/arch/linux.c(_device_set_sector_size): Remove PED_DEVICE_FILE check. --- libparted/arch/linux.c |3 +-- 1 files

[PATCH parted 1/3] linux: use blkid_topology_get_physical_sector_size

2010-01-11 Thread Hans de Goede
The official 2.17 release of util-linux-ng, has added a function to get the physical sector size, use that instead of getting the minimum io size. * libparted/arch/linux.c(_device_set_sector_size): use blkid_topology_get_physical_sector_size. --- libparted/arch/linux.c |2 +- 1 files changed,

[PATCH parted 2/3] linux: Remove unused blkpg.h header file

2010-01-11 Thread Hans de Goede
* libparted/arch/linux.c: Don't include blkpg.h. * libparted/arch/blkpg.h: Deleted. --- libparted/arch/blkpg.h | 64 libparted/arch/linux.c |1 - 2 files changed, 0 insertions(+), 65 deletions(-) delete mode 100644 libparted/arch/blkpg.h dif

Re: [PATCH parted 2/2] linux: Fix use after free in devicemapper code

2009-12-18 Thread Hans de Goede
Hi, On 12/18/2009 01:59 PM, Jim Meyering wrote: Hans de Goede wrote: Is this adjustment ok with you, since I'm leaving your name on it? I don't want to leave the assignments to NULL, since they're effectively dead code and I don't want to provoke warnings from the likes o

Re: [PATCH parted 2/2] linux: Fix use after free in devicemapper code

2009-12-18 Thread Hans de Goede
Hi, On 12/18/2009 01:26 PM, Jim Meyering wrote: Hans de Goede wrote: * libparted/arch/linux.c (_dm_add_partition): Fix use of dm_task information after freeing it. --- libparted/arch/linux.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libparted/arch/linux.c

[PATCH parted 2/2] linux: Fix use after free in devicemapper code

2009-12-18 Thread Hans de Goede
* libparted/arch/linux.c (_dm_add_partition): Fix use of dm_task information after freeing it. --- libparted/arch/linux.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c index 9d15bf2..36a698d 100644 --- a/libparted/arch

[PATCH parted 1/2] ui: Do not truncate flag names when printing

2009-12-18 Thread Hans de Goede
The partition_print_flags() function was truncating the flag names, but these are translated strings, and thus can contain multibyte characters. Truncating multibyte chars in a non multibyte aware way is not good and was causing issues when printing tables in Russian: http://bugzilla.redhat.com/sho

[PATCH parted 2/2] dos: Honor cylinder alignment disk flag when allocating metadata

2009-12-17 Thread Hans de Goede
* libparted/labels/dos.c (add_startend_metadata): Honor cylinder alignment flag. --- libparted/labels/dos.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/libparted/labels/dos.c b/libparted/labels/dos.c index ea8fc0b..581506e 100644 --- a/libparted/labels/dos.c +++ b/

[PATCH parted 1/2] libparted: push/pop update mode around ped_disk_set_flag

2009-12-17 Thread Hans de Goede
Disk flags can change how the metadata gets allocated, so push/pop update mode around ops->disk_set_flag, so that the metadata gets re-allocated. * libparted/disk.c (ped_disk_set_flag): push/pop update mode. --- libparted/disk.c | 13 - 1 files changed, 12 insertions(+), 1 deletions(

[PATCH parted] linux: Treat loopback devices as files

2009-12-11 Thread Hans de Goede
We cannot do partition related ioctl's on loopback devices, so treat them as files. * libparted/arch/linux.c(LOOP_MAJOR): New define. * libparted/arch/linux.c(_device_probe_type): Treat loopback devices as files. --- libparted/arch/linux.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions

[PATCH parted 3/3] parted.texi: Document --align option

2009-12-10 Thread Hans de Goede
doc/parted.texi: Document --align option. --- doc/parted.texi |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/doc/parted.texi b/doc/parted.texi index a1d794d..5704520 100644 --- a/doc/parted.texi +++ b/doc/parted.texi @@ -496,6 +496,11 @@ display a help message @itemx

[PATCH parted 2/3] parted.8: add --align option to manpage

2009-12-10 Thread Hans de Goede
* doc/C/parted.8: add --align option to manpage. --- doc/C/parted.8 | 20 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/doc/C/parted.8 b/doc/C/parted.8 index 9909ba8..2a8992e 100644 --- a/doc/C/parted.8 +++ b/doc/C/parted.8 @@ -30,6 +30,26 @@ never prompts

[PATCH parted 1/3] NEWS: Add new --align option to NEWS

2009-12-10 Thread Hans de Goede
* NEWS: Add new --align option. --- NEWS | 15 +++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/NEWS b/NEWS index 500e060..cd67678 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,21 @@ GNU parted NEWS-*- outline -*- ** New features

[PATCH parted 6/6] libparted: Missing pop update mode in ped_disk_delete_all error path

2009-12-10 Thread Hans de Goede
* libparted/disk.c(ped_disk_delete_all): Add missing update mode pop call in error path. --- libparted/disk.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/libparted/disk.c b/libparted/disk.c index 476ece8..5ca5b74 100644 --- a/libparted/disk.c +++ b/libparted/disk.c

[PATCH parted 3/6] libparted: Add missing update mode pop in duplicate error path

2009-12-10 Thread Hans de Goede
From: Joel Granados Moreno * libparted/disk.c(ped_disk_duplicate): Add missing update mode pop call in error path. --- libparted/disk.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/libparted/disk.c b/libparted/disk.c index 7660ee9..d14fe41 100644 --- a/libparted/di

[PATCH parted 4/6] Makefiles: Don't install s390 dasd internal headers in /usr/include

2009-12-10 Thread Hans de Goede
From: Joel Granados Moreno include/parted/Makefile.am: Don't install s390 dasd internal headers in /usr/include. --- include/parted/Makefile.am |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/parted/Makefile.am b/include/parted/Makefile.am index a1ba960..022

[PATCH parted 5/6] libparted: make pop/push update mode propagate sanity check errors

2009-12-10 Thread Hans de Goede
Sanity check errors indicate something is really really wrong, still sometimes they happen, when they happen it helps a lot in debugging them when the libparted caller immediately errors out at the first moment, rather then slugging along until things crash somewere. * libparted/disk.c(_disk_push_u

[PATCH parted 2/6] gpt: Add support for appletv partitions

2009-12-10 Thread Hans de Goede
From: Joel Granados Moreno * include/parted/disk.h(PedPartitionFlag): Add PED_PARTITION_APPLE_TV_RECOVERY. * libparted/disk.c(ped_partition_flag_get_name): Handle PED_PARTITION_APPLE_TV_RECOVERY. * libparted/labels/gpt.c(PARTITION_APPLE_TV_RECOVERY_GUID): New define. * libparted/labels/gpt.c(GPTP

[PATCH parted 1/6] parted.texi: Document --align option

2009-12-10 Thread Hans de Goede
doc/parted.texi: Document --align option. --- doc/parted.texi |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/doc/parted.texi b/doc/parted.texi index a1d794d..a4090df 100644 --- a/doc/parted.texi +++ b/doc/parted.texi @@ -496,6 +496,11 @@ display a help message @itemx

[PATCH parted 5/5] parted.8: add --align option to manpage

2009-12-10 Thread Hans de Goede
--- doc/C/parted.8 | 20 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/doc/C/parted.8 b/doc/C/parted.8 index 9909ba8..31c33ec 100644 --- a/doc/C/parted.8 +++ b/doc/C/parted.8 @@ -30,6 +30,26 @@ never prompts for user intervention .TP .B -v, --version dis

[PATCH parted 3/5] NEWS: Add new --align option to NEWS

2009-12-10 Thread Hans de Goede
* NEWS: Add new --align option. --- NEWS | 16 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/NEWS b/NEWS index c0b29cc..bf1044d 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,22 @@ GNU parted NEWS-*- outline -*- ** New features

[PATCH parted 4/5] NEWS: update with libblkid and kernel requirements for alignment funcs

2009-12-10 Thread Hans de Goede
* NEWS: Change the note for the align-check command to also reference libblkid, add a note to the libparted alignment functions NEWS entry about libblkid and kernel requirements. --- NEWS |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index bf1044d..5b01e9c

[PATCH parted 1/5] NEWS: Add new disk flag functions to NEWS

2009-12-10 Thread Hans de Goede
* NEWS: Add new disk flag functions. --- NEWS | 12 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/NEWS b/NEWS index 9a0ac2c..c0b29cc 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,18 @@ GNU parted NEWS-*- outline -*- ** New features

[PATCH parted 2/5] parted: add --align commandline option to specify mkpart alignment

2009-12-10 Thread Hans de Goede
The new --align commandline option can have the following values: none: Use the minimum alignment allowed by the disk type cyl: Align partitions to cylinders (the default) min: Use minimum alignment as given by the disk topology information opt: Use optimum alignment as given by the disk top

[PATCH parted 1/3] libparted: add disk flag functions and PED_DISK_CYLINDER_ALIGNMENT flag

2009-12-09 Thread Hans de Goede
Sometimes we want to be able to set flags at the disk level rather then at the parition level, to influence how new partitions will be created for example. This patch adds functions to do this (modelled after the partition flag functions), and adds a PED_DISK_CYLINDER_ALIGNMENT flag. This flag (wh

[PATCH parted 3/3] dasd: fix memleak in dasd_free

2009-12-09 Thread Hans de Goede
* libparted/labels/dasd.c(dasd_free): free disk_specific data. --- libparted/labels/dasd.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/libparted/labels/dasd.c b/libparted/labels/dasd.c index dd492f2..57612a3 100644 --- a/libparted/labels/dasd.c +++ b/libparted/label

[PATCH parted 2/3] msdos, sun: Implement disk flag operations

2009-12-09 Thread Hans de Goede
* libparted/labels/dos.c(DosDiskData): New struct. * libparted/labels/dos.c(msdos_alloc, msdos_duplicate, msdos_free): Handle per disk DosDiskData. * libparted/labels/dos.c(msdos_disk_set_flag, msdos_disk_get_flag, msdos_disk_is_flag_available): New functions. * libparted/labels/sun.c(sun_disk_set_

[PATCH parted] Update NEWS file for my recent patches

2009-11-10 Thread Hans de Goede
--- NEWS | 18 ++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/NEWS b/NEWS index c8c5724..6564ab8 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,18 @@ GNU parted NEWS-*- outline -*- * Noteworthy changes in release ?.? (-??-?

Re: [PATCH parted] dasd: Fix ped_disk_new_fresh() to not read old data from disk (rh533808)

2009-11-10 Thread Hans de Goede
Hi, On 11/09/2009 06:28 PM, Jim Meyering wrote: Hans de Goede wrote: dasd_write(), was reading the volume label from the disk (trough fdasd_check_volume()) and later writing it back again, this is fine for existing dasd labels, but when creating a fresh label, this would also cause the old

[PATCH parted] dasd: Fix ped_disk_new_fresh() to not read old data from disk (rh533808)

2009-11-09 Thread Hans de Goede
dasd_write(), was reading the volume label from the disk (trough fdasd_check_volume()) and later writing it back again, this is fine for existing dasd labels, but when creating a fresh label, this would also cause the old volume label to be re-used, and if the old label was corrupt, it would cause

Re: [PATCH parted 1/5] dasd: Cleanup anchor handling

2009-11-04 Thread Hans de Goede
Hi, On 11/04/2009 10:32 AM, Jim Meyering wrote: Hans de Goede wrote: The current dasd label code keeps an fdasd anchor struct in the DasdDiskSpecific struct, and fills this during dasd_read. However this anchor does not get updated with any future mods, until dasd_write, at which points it

[PATCH parted 2/5] dasd: Remove (bogus) part_info pointer from DasdPartitionData

2009-11-03 Thread Hans de Goede
The part_info pointer in DasdPartitionData was only used to pass fdasd partition_info_t pointers from dasd_write to the dasd_write dasd_update_type utility function. Since these pointers are not valid outside the lifetime of dasd_write, they should not be stored in the longer lived DasdPartitionDat

[PATCH parted 5/5] dasd: fix disk duplication

2009-11-03 Thread Hans de Goede
Fix dasd_duplicate and add a dasd_partition_duplicate function. * libparted/labels/dasd.c(dasd_partition_duplicate): New function. (dasd_duplicate): Don't set the disk_specific pointer to NULL! (dasd_duplicate): Copy DasdDiskSpecific from old disk to new disk. --- libparted/labels/dasd.c | 24 ++

[PATCH parted 4/5] dasd: Set disk_specific->format_type in dasd_alloc

2009-11-03 Thread Hans de Goede
Set disk_specific->format_type in dasd_alloc, so that the disk returned by ped_disk_new_fresh is a valid dasd disk. * libparted/labels/dasd.c (dasd_alloc): Set disk_specific->format_type. --- libparted/labels/dasd.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/libpart

[PATCH parted 3/5] dasd: cache real_sector_size in linux_probe

2009-11-03 Thread Hans de Goede
dasd_alloc was doing an ioctl to get the real sector size for the dasd device (we are faking 512 bytes sectors), but when called directly from ped_disk_new_fresh(), the device is not open causing this to fail. This patch fixes things by caching the real_sector_size in the linux arch_specific data

[PATCH parted 1/5] dasd: Cleanup anchor handling

2009-11-03 Thread Hans de Goede
The current dasd label code keeps an fdasd anchor struct in the DasdDiskSpecific struct, and fills this during dasd_read. However this anchor does not get updated with any future mods, until dasd_write, at which points it gets completely re-initialized. Since the contents of the anchor saved durin

[PATCH parted 1/3] linux: Use major / minor to specify device mapper device in dm_task

2009-11-02 Thread Hans de Goede
Use major / minor to specify device mapper device instead of dm_task_set_name. This is needed for upcoming lvm changes where the /dev/mapper/foobar files are becoming symlinks, so we will end up opening /dev/dm-#, and dm-# is not a valid dm_task name. This is only needed in this one place, as in t

[PATCH parted 2/3] linux: Use devicemapper task name instead of device node name

2009-11-02 Thread Hans de Goede
Use devicemapper task name instead of device node name as basename for devicemapper disk partitions. This is needed for upcoming lvm changes where the /dev/mapper/foobar files are becoming symlinks, so we will end up opening /dev/dm-#, and naming our partitions dm-#p1, dm-#p2, instead of foobarp1,

[PATCH parted 3/3] linux: Use cached major minor instead of statting the device again

2009-11-02 Thread Hans de Goede
--- libparted/arch/linux.c | 10 -- 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c index 3ca938a..a87f7e2 100644 --- a/libparted/arch/linux.c +++ b/libparted/arch/linux.c @@ -2333,22 +2333,20 @@ err: static int _dm_remove_

[PATCH parted 7/7] Implement get_partition_alignment DiskOp for all labels which need it

2009-10-30 Thread Hans de Goede
Implement get_partition_alignment DiskOp for all labels which require an alignment with a grain_size != 1. --- libparted/labels/dasd.c | 12 libparted/labels/mac.c | 11 ++- libparted/labels/pc98.c | 12 +++- libparted/labels/rdb.c | 12 +++- libparte

[PATCH parted 6/7] libparted: add ped_disk_get_partition_alignment() function

2009-10-30 Thread Hans de Goede
This functions get the alignment needed for partition boundaries on this disk. The returned alignment describes the alignment for the start sector of the partition, for all disklabel types which require alignment, except Sun disklabels, the end sector must be aligned too. To get the end sector alig

[PATCH parted 4/7] ped_device_get_constraint: return constraint without alignment

2009-10-30 Thread Hans de Goede
In libparted-1.9 ped_device_get_constraint() would always return a constraint without any start / end aligning (grain_size == 1). Now that we are starting to support disks with a physical sector size other then 512, the old ped_device_get_constraint() code may actually start returning constrains wi

[PATCH parted 3/7] linux: add get_xxx_alignment() functions

2009-10-30 Thread Hans de Goede
* libparted/arch/linux.c (get_minimum_alignment): New function. (get_optimum_alignment): New function. --- libparted/arch/linux.c | 34 +- 1 files changed, 33 insertions(+), 1 deletions(-) diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c index a03c80d

[PATCH parted 2/7] linux: save blkid topology in arch_specific data for later use

2009-10-30 Thread Hans de Goede
This is a preparation patch for adding get_minimum_alignment and get_optimum_alignment functions to linux's _PedDeviceArchOps. * libparted/arch/linux.h (struct_LinuxSpecific) [probe, topology]: Add members. * libparted/arch/linux.c (linux_new): initialize arch_specific->probe and arch_specific->top

[PATCH parted 5/7] libparted: add ped_device_get_xxx_aligned_constraint() functions

2009-10-30 Thread Hans de Goede
Add ped_device_get_minimal_aligned_constraint() and ped_device_get_optimal_aligned_constraint() functions to libparted. These functions can be used to get a device constraint taking alignment into account. --- include/parted/device.h |5 +++ libparted/device.c | 69

[PATCH parted 1/7] libparted: add ped_device_get_xxx_alignment() functions

2009-10-30 Thread Hans de Goede
Add ped_device_get_minimum_alignment() and ped_device_get_optimum_alignment() functions to libparted. Note this is a resent of my previous patchset with a number of typos corrected: aligment -> alignment minimal_alignment -> minimum_aligment optimal_alignment -> optimum_aligment Sorry for the noi

[PATCH parted 2/2] linux: Don't return bogus device alignment info

2009-10-30 Thread Hans de Goede
* libparted/arch/linux.c (linux_get_xxx_alignment): blkid's topology io size may be 0 when blkid could not get the minimum / optimum iosize. Return NULL in this case instead of returning a bogus (grain_size == 0) alignment. --- libparted/arch/linux.c |4 ++-- 1 files changed, 2 insertions(+),

[PATCH parted 1/2] linux: fix crash (un-initialized pointer) when operating on regular files

2009-10-30 Thread Hans de Goede
* libparted/arch/linux.c (linux_new): When compiled with blkid support initialize arch_specific->probe and arch_specific->topology to NULL, as get_blkid_topology(), which sets them, does not get called for regular files. * libparted/arch/linux.c (get_blkid_topology): No need to set arch_specific->t

Re: [PATCH parted 1/7] libparted: add ped_device_get_xxx_alignment() functions

2009-10-30 Thread Hans de Goede
Hi, On 10/29/2009 05:38 PM, Jim Meyering wrote: Hans de Goede wrote: Add ped_device_get_minimum_alignment() and ped_device_get_optimum_alignment() functions to libparted. Note this is a resent of my previous patchset with a number of typos corrected: aligment -> alignment minimal_alignm

[PATCH parted 3/7] linux.c: add get_minimum_alignment() and get_optimum_alignment() functions

2009-10-29 Thread Hans de Goede
--- libparted/arch/linux.c | 34 +- 1 files changed, 33 insertions(+), 1 deletions(-) diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c index 176e7da..3069c59 100644 --- a/libparted/arch/linux.c +++ b/libparted/arch/linux.c @@ -2521,6 +2521,34 @@ linux

[PATCH parted 6/7] libparted: add ped_disk_get_partition_alignment() function

2009-10-29 Thread Hans de Goede
This functions get the alignment needed for partition boundaries on this disk. The returned alignment describes the alignment for the start sector of the partition, for all disklabel types which require alignment, except Sun disklabels, the end sector must be aligned too. To get the end sector alig

[PATCH parted 7/7] Implement get_partition_alignment DiskOp for all labels which need it

2009-10-29 Thread Hans de Goede
Implement get_partition_alignment DiskOp for all labels which require an alignment with a grain_size != 1. --- libparted/labels/dasd.c | 12 libparted/labels/mac.c | 11 ++- libparted/labels/pc98.c | 12 +++- libparted/labels/rdb.c | 12 +++- libparte

[PATCH parted 5/7] libparted: add ped_device_get_xxx_aligned_constraint() functions

2009-10-29 Thread Hans de Goede
Add ped_device_get_minimal_aligned_constraint() and ped_device_get_optimal_aligned_constraint() functions to libparted. These functions can be used to get a device constraint taking alignment into account. --- include/parted/device.h |5 +++ libparted/device.c | 69

[PATCH parted 1/7] libparted: add ped_device_get_xxx_alignment() functions

2009-10-29 Thread Hans de Goede
Add ped_device_get_minimum_alignment() and ped_device_get_optimum_alignment() functions to libparted. Note this is a resent of my previous patchset with a number of typos corrected: aligment -> alignment minimal_alignment -> minimum_aligment optimal_alignment -> optimum_aligment Sorry for the noi

[PATCH parted 2/7] linux.c: save blkid topology in arch_specific data for later use

2009-10-29 Thread Hans de Goede
This is a preparation patch for adding get_minimum_alignment and get_optimum_alignment functions to linux's _PedDeviceArchOps. --- libparted/arch/linux.c | 75 ++-- libparted/arch/linux.h |8 + 2 files changed, 36 insertions(+), 47 deletions(-)

[PATCH parted 4/7] ped_device_get_constraint: return constraint without alignment

2009-10-29 Thread Hans de Goede
In libparted-1.9 ped_device_get_constraint() would always return a constraint without any start / end aligning (grain_size == 1). Now that we are starting to support disks with a physical sector size other then 512, the old ped_device_get_constraint() code may actually start returning constrains wi

[PATCH parted 6/7] libparted: add ped_disk_get_partition_alignment() function

2009-10-29 Thread Hans de Goede
This functions get the aligment needed for partition boundaries on this disk. The returned alignment describes the aligment for the start sector of the partition, for all disklabel types which require alignment, except Sun disklabels, the end sector must be aligned too. To get the end sector aligme

[PATCH parted 4/7] ped_device_get_constraint: return constraint without alignment

2009-10-29 Thread Hans de Goede
In libparted-1.9 ped_device_get_constraint() would always return a constraint without any start / end aligning (grain_size == 1). Now that we are starting to support disks with a physical sector size other then 512, the old ped_device_get_constraint() code may actually start returning constrains wi

[PATCH parted 7/7] Implement get_partition_alignment DiskOp for all labels which need it

2009-10-29 Thread Hans de Goede
Implement get_partition_alignment DiskOp for all labels which require an alignment with a grain_size != 1. --- libparted/labels/dasd.c | 12 libparted/labels/mac.c | 11 ++- libparted/labels/pc98.c | 12 +++- libparted/labels/rdb.c | 12 +++- libparte

[PATCH parted 5/7] libparted: add ped_device_get_xxx_aligned_constraint() functions

2009-10-29 Thread Hans de Goede
Add ped_device_get_minimal_aligned_constraint() and ped_device_get_optimal_aligned_constraint() functions to libparted. These functions can be used to get a device constraint taking alignment into account. --- include/parted/device.h |5 +++ libparted/device.c | 69

[PATCH parted 2/7] linux.c: save blkid topology in arch_specific data for later use

2009-10-29 Thread Hans de Goede
This is a preparation patch for adding get_minimal_alignment and get_optimal_alignment functions to linux's _PedDeviceArchOps. --- libparted/arch/linux.c | 75 ++-- libparted/arch/linux.h |8 + 2 files changed, 36 insertions(+), 47 deletions(-)

[PATCH parted 3/7] linux.c: add get_minimal_alignment() and get_optimal_alignment() functions

2009-10-29 Thread Hans de Goede
--- libparted/arch/linux.c | 34 +- 1 files changed, 33 insertions(+), 1 deletions(-) diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c index 176e7da..b6070d7 100644 --- a/libparted/arch/linux.c +++ b/libparted/arch/linux.c @@ -2521,6 +2521,34 @@ linux

[PATCH parted 1/7] libparted: add ped_device_get_xxx_aligment() functions

2009-10-29 Thread Hans de Goede
Add ped_device_get_minimal_aligment() and ped_device_get_optimal_aligment() functions to libparted. --- include/parted/device.h |8 include/parted/natmath.h |1 + libparted/device.c | 43 +++ 3 files changed, 52 insertions(+), 0 del

Re: [PATCH parted 1/5] libparted: add ped_device_get_xxx_aligment() functions

2009-10-29 Thread Hans de Goede
Hi, Me again I forgot one part of my reply: On 10/28/2009 10:26 PM, Jim Meyering wrote: @@ -31,6 +31,7 @@ typedef struct _PedAlignment PedAlignment; #include #include +#include Might as well indent consistently. This is your mail client playing tricks, all 3 includes are not ind

Re: [PATCH parted 1/5] libparted: add ped_device_get_xxx_aligment() functions

2009-10-29 Thread Hans de Goede
Hi, On 10/28/2009 10:26 PM, Jim Meyering wrote: Hans de Goede wrote: Note, these patches may apply to master with a couple of lines offset left and right, as I also have some patches in my local tree to update parted to keep working with upcoming lvm2 (libdevmapper) changes, I'm still wa

Re: [PATCH parted 1/5] libparted: add ped_device_get_xxx_aligment() functions

2009-10-28 Thread Hans de Goede
efore submitting them. Regards, Hans p.s. I also plan to backport this set of 5 to libparted-1.9 and add them to the Fedora packages for F-13. On 10/28/2009 10:20 PM, Hans de Goede wrote: Add ped_device_get_minimal_aligment() and ped_device_get_optimal_aligment() functions to libparted. --- in

[PATCH parted 4/5] Take alignment offset into account in ped_device_get_constraint()

2009-10-28 Thread Hans de Goede
ped_device_get_constraint() was trying to do aligment based on physical sector / logical sector differences, but this does not take alignment offset into account. So use ped_device_get_minimal_aligment() instead. Note this may seem a regression for arch's which don't implement ped_device_get_minim

[PATCH parted 3/5] linux.c: add get_minimal_alignment() and get_optimal_alignment() functions

2009-10-28 Thread Hans de Goede
--- libparted/arch/linux.c | 34 +- 1 files changed, 33 insertions(+), 1 deletions(-) diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c index d261a04..32e8af9 100644 --- a/libparted/arch/linux.c +++ b/libparted/arch/linux.c @@ -2521,6 +2521,34 @@ linux

  1   2   >