[Parted-maintainers] Bug#380226: Maybe ped_disk_set_partition_geom() needs the exact constraints argument?

Andree Leidenfrost andree at debian.org
Sun Dec 10 07:10:52 CET 2006


Hi Frans, all,

On Thursday 27 July 2006 14:05, Frans Pop wrote: 
> Conclusion: either resize_partition calls the wrong libparted function,
> or there is a bug in parted's ped_disk_set_partition_geom function.

Looking at the definition of ped_disk_set_partition_geom() in libparted/disk.c,
line 1889 ff., version 1.7.1-3, has this in the preceding comment:

[...]
* \warning The constraint warning from ped_disk_add_partition() applies.
[...]

The definition of ped_disk_add_partition() further up has this in the preceding
comment:

[...]
* \warning The partition's geometry may be changed, subject to \p constraint.
 * You could set \p constraint to <tt>ped_constraint_exact(&part->geom)</tt>, but
 * many partition table schemes have special requirements on the start
 * and end of partitions.  Therefore, having an overly strict constraint
 * will probably mean that this function will fail (in which
 * case \p part will be left unmodified)
 * \p part is assigned a number (\p part->num) in this process.
[...]


So, maybe this is not so much an issue of the ped_disk_set_partition_geom()
function being actually wrong but rather calling it with the exact constraint?


_add_duplicate_part () even further up has this:

[...]
constraint_exact = ped_constraint_exact (&new_part->geom);
[...]

Looking at partman-base-99's parted_server.c, in resize_partition() I see:

[...]
if (NULL != fs)
	constraint = ped_file_system_get_resize_constraint(fs);
else
	constraint = ped_constraint_any(disk->dev);
if (!ped_disk_set_partition_geom(disk, part, constraint, start, end))
	result = false;
else if (NULL == fs)
	result = true;
else if (timered_file_system_resize(fs, &(part->geom))) {
	result = true;
} else {
	ped_disk_set_partition_geom(disk, part,
				    ped_constraint_any(disk->dev),
                                    old_start, old_end);
	result = false;
}
[...]

Would it be possible to change/amend the above so that parted_server calls
ped_disk_set_partition_geom() with the exact constraint set in case the
partition to resize contains a Vista NTFS filesystem?

Best regards,
Andree
-- 
Andree Leidenfrost
@ Debian Developer
Sydney - Australia

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.alioth.debian.org/pipermail/parted-maintainers/attachments/20061210/469b0e0d/attachment.pgp


More information about the Parted-maintainers mailing list