[haiku-commits] Re: r41986 - haiku/trunk/src/kits/storage/disk_device

  • From: Jérôme Duval <korli@xxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 7 Jun 2011 13:04:30 +0200

Hi Stephan,

2011/6/7 Stephan Assmus <superstippi@xxxxxx>:
> Am 07.06.2011 00:23, schrieb korli@xxxxxxxxxxxxxxxx:
>>
>> Log:
>> Second try at fixing #7572 (after r41842). Please review.
>>
>>
>> Modified: haiku/trunk/src/kits/storage/disk_device/Partition.cpp
>> ===================================================================
>> --- haiku/trunk/src/kits/storage/disk_device/Partition.cpp      2011-06-06
>> 20:37:43 UTC (rev 41985)
>> +++ haiku/trunk/src/kits/storage/disk_device/Partition.cpp      2011-06-06
>> 22:23:44 UTC (rev 41986)
>> @@ -1176,7 +1176,7 @@
>>  bool
>>  BPartition::CanInitialize(const char* diskSystem) const
>>  {
>> -       return fDelegate&&  fDelegate->CanInitialize(diskSystem);
>> +       return IsDevice() || (fDelegate&&
>>  fDelegate->CanInitialize(diskSystem));
>>  }
>
> Without having looked at the surounding code recently, it looks a bit as if
> a partition would now always claim support for initializing if it's a
> device, even when the partitioning system in question does not support
> initializing. I think DriveSetup does not show entries for partitioning
> systems that don't support initializing, but technically, a partition may
> now claim support for initializing as exFAT when it is a device, for
> example. Don't know if that is really the case, as I said, just judging by
> the small bit of code above.

I wondered the same thing in fact. Technically it's possible to
initialize a device having a partitioning system with a filesystem.
It's just a bit tricky to know if the API should enforce for instance
to give this possibility only and only when the device hosts no
partition system. One would then have to delete the partitioning
system first.

Bye,
Jérôme

Other related posts: