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)
pgpj3AJbaQrCt.pgp
Description: PGP signature
_______________________________________________ parted-devel mailing list [email protected] http://lists.alioth.debian.org/mailman/listinfo/parted-devel

