bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH parted] libparted: copy needs_clobber value in ped_disk_dupli


From: Jim Meyering
Subject: Re: [PATCH parted] libparted: copy needs_clobber value in ped_disk_duplicate()
Date: Sat, 20 Feb 2010 16:12:18 +0100

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]