OSDN Git Service

* cs/geom.c (ped_geometry_read): Do not throw PED_EXCEPTION_ERROR here
authorDavid Cantrell <dcantrell@redhat.com>
Mon, 9 Oct 2006 18:33:48 +0000 (18:33 +0000)
committerDavid Cantrell <dcantrell@redhat.com>
Mon, 9 Oct 2006 18:33:48 +0000 (18:33 +0000)
   if accessing sectors outside of partition boundary. Returning false
   causes ped_geometry_check() to shift correctly anyway.  This occurs
   on current Mac disklabels, among other systems.

git-svn-id: svn://svn.debian.org/svn/parted/upstream/trunk@845 2d424fd7-7fe2-0310-af74-8bc65edeb173

AUTHORS
libparted/ChangeLog
libparted/cs/geom.c

diff --git a/AUTHORS b/AUTHORS
index c6ad983..d550650 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -206,6 +206,8 @@ David Cantrell <dcantrell@redhat.com>
        * Prevent SIGFPE when FAT sector size is 0
        * Add virtual DASD (VIODASD) on iSeries support
        * Use O_DIRECT I/O to prevent first partition corruption on GPT disks
+   * Prevent sector reading exceptions from ped_geometry_check() on Mac
+   disklabels.
 
 Peter Jones <pjones@redhat.com>
        * Add ped_exception_get_handler()
index 9648d62..2b10f68 100644 (file)
@@ -3,6 +3,11 @@
        == NULL and the given type is not in the list of registered disk types
        (from Debarshi Ray).
 
+       * cs/geom.c (ped_geometry_read): Do not throw PED_EXCEPTION_ERROR here
+       if accessing sectors outside of partition boundary. Returning false
+       causes ped_geometry_check() to shift correctly anyway.  This occurs
+       on current Mac disklabels, among other systems.
+
 2006-10-06  David Cantrell  <dcantrell@redhat.com>
        * arch/linux.c: Change __GNU_SOURCE define to _GNU_SOURCE (only one
        underscore at the beginning). Fixes problem with certain systems
index 29c89e7..4d2f5e7 100644 (file)
@@ -298,15 +298,8 @@ ped_geometry_read (const PedGeometry* geom, void* buffer, PedSector start,
        
        real_start = geom->start + start;
 
-       if (real_start + count - 1 > geom->end) {
-               exception_status = ped_exception_throw (
-                       PED_EXCEPTION_ERROR, PED_EXCEPTION_IGNORE_CANCEL,
-                       _("Attempt to read sectors %ld-%ld outside of "
-                         "partition on %s."),
-                       (long) start, (long) (start + count - 1),
-                       geom->dev->path);
-               return exception_status == PED_EXCEPTION_IGNORE;
-       }
+       if (real_start + count - 1 > geom->end)
+               return 0;
 
        if (!ped_device_read (geom->dev, buffer, real_start, count))
                return 0;