Guys,

  I had a look at the latest version of libparted. Here also in function 
ped_disk_new(), disk->needs_clobber is set to 0 after type->ops->read(disk). 
Why do we want to keep need_clobber set to 1 while reading the partition table 
? I think needs_clobber should be set to 0 before partition table is read.

Please see the code below:

PedDisk*
ped_disk_new (PedDevice* dev)
{
..
..

         disk = ped_disk_new_fresh (dev, type);
        if (!disk)
                goto error_close_dev;
                                         <-- disk->needs_clobber should be
                                             set to 0 here.
        if (!type->ops->read (disk))
                goto error_destroy_disk;
        disk->needs_clobber = 0;        
        
..
..
}

gpt_read() tries to correct the partition table in case primary or secondary is 
corrupted. If needs_clobber is set, gpt_read() will try to clobber the 
partition table signatures which is incorrect (in case write_back is set).
Why do we need to remove other partition table signatures while reading a 
partition table ?

thanks,
rahul

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

Reply via email to