On 05/15/2013 09:03 AM, Jan Safranek wrote:
On 05/15/2013 03:34 AM, David Lehman wrote:
> On Tue, 2013-05-14 at 16:33 -0700, Brian C. Lane wrote:
>> From: "Brian C. Lane" <bcl(a)redhat.com>
>>
>> If a partition is created in the same position as a previous filesystem,
>> eg. a LVM pv, udev will activate it and cause the device to be busy,
>> preventing us from using it.
>>
>> This uses the parted information from parted to calculate the start of
>> the partition and calls dd to write zeros to the first 10MiB of the
>> partition.
>>
>> This also rescans the pv to make sure things stay in sync with the
>> filesystem when creating and removing pvs.
>
> I'd probably call self._wipe() before that try/except block instead of
> inside it, but that's just a matter of preference.
>
> This patch is disgusting, but also reeks of robustness. Ack, I guess.
If the patch is just about wiping physical volumes, maybe lesser amount
than 10MB could do the same work. Also I'd appreciate some check that
the created partition is greater than this 10 MB, just in case.
Oops, the check is already there, sorry.
Jan