It seem that the only maintained source archive for GNU parted is git://git.debian.org/git/parted/parted.git . Right ?

I managed to find that the bug was introduced by this commit:

commit c79d91ec71882a1673daae0482aa90c514c63cc1
Author: Jim Meyering <meyer...@redhat.com>
Date:   Tue Mar 30 16:50:59 2010 +0200

    dos: accommodate very small devices (useful for testing)

    * libparted/labels/dos.c (_primary_constraint): Don't pass a negative
    "device_length" to ped_geometry_init when the underlying device
    has fewer sectors than a "cylinder".

diff --git a/libparted/labels/dos.c b/libparted/labels/dos.c
index 752f186..8679c49 100644
--- a/libparted/labels/dos.c
+++ b/libparted/labels/dos.c
@@ -1616,8 +1616,13 @@ _primary_constraint (const PedDisk* disk, const PedCHSGeometry* bios_geom,
                                        dev->length - min_geom->end))
                        return NULL;
        } else {
-               if (!ped_geometry_init (&start_geom, dev, cylinder_size,
-                                       dev->length - cylinder_size))
+               /* Do not assume that length is larger than 1 cylinder's
+                  worth of sectors.  This is useful when testing with
+                  a memory-mapped "disk" (a la scsi_debug) that is say,
+                  2048 sectors long.  */
+               if (cylinder_size < dev->length
+                   && !ped_geometry_init (&start_geom, dev, cylinder_size,
+                                          dev->length - cylinder_size))
                        return NULL;
                if (!ped_geometry_init (&end_geom, dev, 0, dev->length))
                        return NULL;


I posted a message on the bug-par...@gnu.org, but it seem that there is not a lot of developers on it, so I don't expect this will be handled anytime soon.

The only basic idea I have right now, is to add a "-t" option to force to not call ped_geometry_init (&start_geom, ...) if cylinder_size < dev->length when using parted with a memory-mapped device for testing purpose. There is maybe a better logic to handle all of that, but I don't know this code good enough to see it. Where can I find a test case with a memory-mapped device that needed this commit ?

Jean-Christian de Rivaz



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to