[parted-devel] > 63 heads. Why does this keep coming up?

Brian C. Lane bcl at redhat.com
Mon Feb 28 18:24:15 UTC 2011


On Sun, Feb 27, 2011 at 10:57:19AM -0500, Phillip Susi wrote:
> On 02/12/2011 05:05 PM, Phillip Susi wrote:
> >I have patched the function to not use PED_ASSERT() so it properly
> >returns 0 when the constraints fail. This seems to fix the issue. Please
> >review for application:
> 
> Does anyone else ( Jim? ) have a comment on this patch, or why
> PED_ASSERT() does not seem to work properly?  Specifically why it
> ignores its second argument that the original code seems to assume
> will be executed instead of calling exit()?  Understanding that will
> help explain why this patch is needed, then if there are no
> objections, it could be applied?

PED_ASSERT is actually working correctly, the 2nd parameter (action)
isn't used by the macro at all.

Looking at the code for probe_partition_for_geom() it is apparent that
this is a bit of a complicated problem (if you have to apply matrix math
to figure out the CHS...) so it is probably correct to throw an
assertion -- it is indicating a failure in the algorithm to determine
the correct values.

I've looked at the sfdisk code which seems to work, but it is much
harder to read than parted's code, and takes a different approach (I
think).

I do think it would be useful to dump all the variables used in the
calculation instead of just an assertion, that way we wouldn't need to
ask the user for the partition table.

I think we've had a couple of people post their partition tables, I'm
going to see if I can run gdb against those and figure out what is
failing.

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 482 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/parted-devel/attachments/20110228/48b1da69/attachment.pgp>


More information about the parted-devel mailing list