[parted-devel] [PATCH] Always allow at least two sectors for extended boot record

Phillip Susi psusi at cfl.rr.com
Wed Apr 21 21:08:32 UTC 2010


On 4/21/2010 4:50 PM, Jim Meyering wrote:
> IMHO, parted should err on the side of safety.
> Imagine a script getting the warning.  It should not
> have to parse stderr to determine that it must not proceed.
> 
>> Maybe something other than PED_EXCEPTION_IGNORE
>> should be used?  Perhaps ignore or fail?

I think you will satisfy both by using PED_EXCEPTION_IGNORE_CANCEL (
there doesn't seem to be an ignore or fail ).  That way the message is
printed and you have to either choose to ignore and parted will exit
with a status of 0, or you choose to cancel and it exits with a failure
code.

> BTW, wouldn't this diagnostic do better to say how we've failed
> to notify the kernel of changes that we've written to disk?
> 
> +        if (parts[0]) {
> +                parts[strlen (parts) - 2] = 0;
> +                ped_exception_throw (
> +                        PED_EXCEPTION_WARNING,
> +                        PED_EXCEPTION_IGNORE,
> +                        _("Partition(s) %s on %s could not be modified, probably "
> +                          "because it/they is/are in use.  As a result, the old partition(s) "
> +                          "will remain in use until after reboot. You should reboot "
> +                          "now before making further changes."),
> +                        parts, disk->dev->path);
> +        }

I'm confused now.  I thought "say how we've failed to notify the kernel
of changes we've written to disk" is exactly what it does.




More information about the parted-devel mailing list