From 262b145d58a1629c2c495801a77e70542a55ab4a Mon Sep 17 00:00:00 2001
From: Augustin Cavalier <waddlesplash@gmail.com>
Date: Sat, 5 Jul 2014 16:57:26 -0400
Subject: [PATCH] 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.
---
src/system/kernel/disk_device_manager/KPartitioningSystem.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/system/kernel/disk_device_manager/KPartitioningSystem.cpp b/src/system/kernel/disk_device_manager/KPartitioningSystem.cpp
index 790028e..46e24c8 100644
a
|
b
|
KPartitioningSystem::Identify(KPartition *partition, void **cookie)
|
69 | 69 | int fd = -1; |
70 | 70 | if (partition->Open(O_RDONLY, &fd) != B_OK) |
71 | 71 | return -1; |
| 72 | |
| 73 | // if BlockSize is 0, identify_partition will cause a KDL |
| 74 | if (partition->BlockSize() == 0) |
| 75 | return -1; |
| 76 | |
72 | 77 | float result = fModule->identify_partition(fd, partition->PartitionData(), |
73 | 78 | cookie); |
74 | 79 | close(fd); |