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

  • From: Stephan Assmus <superstippi@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 07 Jun 2011 13:11:58 +0200

Hi,

Am 07.06.2011 13:04, schrieb Jérôme Duval:
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.

That is not the same question I tried to point out. But you are right. I'm thinking it would be no problem to allow to initialize a device with a filesystem or in fact partitioning system (same or another), when it already contains one. The warning that DriveSetup displays in this situation could be a bit different, though.

Best regards,
-Stephan

Other related posts: