Hans de Goede wrote:
> Most duplicate disk_ops use ped_disk_new_fresh, which sets needs_clobber
> to 1. This would lead to clobbering the disk when committing a duplicate
> disk even when the original disk was not made with ped_disk_new_fresh.
> * libparted/disk.c (ped_disk_duplicate): copy needs_clobber value.
> ---
>  libparted/disk.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/libparted/disk.c b/libparted/disk.c
> index b819d59..fc5ef17 100644
> --- a/libparted/disk.c
> +++ b/libparted/disk.c
> @@ -276,6 +276,9 @@ ped_disk_duplicate (const PedDisk* old_disk)
>       }
>       if (!_disk_pop_update_mode (new_disk))
>               goto error_destroy_new_disk;
> +
> +        new_disk->needs_clobber = old_disk->needs_clobber;
> +

Hi Hans,

Can you give me a quick summary of that for NEWS?

Also, testing for the bug... Does this sound right?

Create a disk with nonzero data in the MBR, reset its needs_clobber flag,
then copy it using ped_disk_duplicate, and ensure that the contents of
the MBR are preserved in the copy.


_______________________________________________
bug-parted mailing list
bug-parted@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-parted

Reply via email to