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 <[email protected]>
This commit is contained in:
committed by
Jessica Hamilton
parent
6c2a6f092c
commit
ba38276d19
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user