[haiku-commits] haiku: hrev47468 - src/system/kernel/disk_device_manager

  • From: jessica.l.hamilton@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 6 Jul 2014 00:26:01 +0200 (CEST)

hrev47468 adds 1 changeset to branch 'master'
old head: 6c2a6f092c17c9337093ca1163fe0f7314b011ac
new head: ba38276d1995b0538693445a5b65ef03c5c675df
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=ba38276+%5E6c2a6f0

----------------------------------------------------------------------------

ba38276: Ensure partition block size is not 0.
  
   * I tried having this test in KDiskDeviceManager.cpp, but it
     failed booting in one case and did not solve the problem in another.
     I think this is because there is an Open() call here, and that rereads
     the blocksize.
   * Tested and it solved the problem for me.
   * Should fix #10717 and #9489 at least.
  
  Signed-off-by: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>

                              [ Augustin Cavalier <waddlesplash@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev47468
Commit:      ba38276d1995b0538693445a5b65ef03c5c675df
URL:         http://cgit.haiku-os.org/haiku/commit/?id=ba38276
Author:      Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date:        Sat Jul  5 20:57:26 2014 UTC
Committer:   Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Commit-Date: Sat Jul  5 22:24:14 2014 UTC

Ticket:      https://dev.haiku-os.org/ticket/9489
Ticket:      https://dev.haiku-os.org/ticket/10717

----------------------------------------------------------------------------

1 file changed, 5 insertions(+)
src/system/kernel/disk_device_manager/KPartitioningSystem.cpp | 5 +++++

----------------------------------------------------------------------------

diff --git a/src/system/kernel/disk_device_manager/KPartitioningSystem.cpp 
b/src/system/kernel/disk_device_manager/KPartitioningSystem.cpp
index 790028e..e36070d 100644
--- a/src/system/kernel/disk_device_manager/KPartitioningSystem.cpp
+++ b/src/system/kernel/disk_device_manager/KPartitioningSystem.cpp
@@ -69,6 +69,11 @@ KPartitioningSystem::Identify(KPartition *partition, void 
**cookie)
        int fd = -1;
        if (partition->Open(O_RDONLY, &fd) != B_OK)
                return -1;
+
+       // if BlockSize is 0, identify_partition will cause a KDL
+       if (partition->BlockSize() == 0)
+               return -1;
+
        float result = fModule->identify_partition(fd, 
partition->PartitionData(),
                cookie);
        close(fd);


Other related posts: