[haiku-commits] haiku: hrev45192 - in src/add-ons: disk_systems/intel kernel/partitioning_systems/gpt

  • From: axeld@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 24 Jan 2013 00:46:38 +0100 (CET)

hrev45192 adds 2 changesets to branch 'master'
old head: 61ba12594bf9f447b1384bda0bcd8e4b1e56e315
new head: 99fc216a95a1db7b9b2ab905e9ee6af4baccc201
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=99fc216+%5E61ba125

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

2077b23: intel disk system: restrict maximum supported size.
  
  * The MBR can only address 2^32 blocks.
  * This prevents you from initializing a disk larger than 2TB with a block
    size of 512 bytes.

99fc216: gpt: do not advertize the partition as read-only.

                                   [ Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> ]

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

2 files changed, 5 insertions(+), 3 deletions(-)
src/add-ons/disk_systems/intel/PartitionMapAddOn.cpp    | 6 ++++--
src/add-ons/kernel/partitioning_systems/gpt/efi_gpt.cpp | 2 +-

############################################################################

Commit:      2077b23f14bdb01492cdc481bf5898446ba939aa
URL:         http://cgit.haiku-os.org/haiku/commit/?id=2077b23
Author:      Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
Date:        Wed Jan 23 23:44:26 2013 UTC

intel disk system: restrict maximum supported size.

* The MBR can only address 2^32 blocks.
* This prevents you from initializing a disk larger than 2TB with a block
  size of 512 bytes.

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

diff --git a/src/add-ons/disk_systems/intel/PartitionMapAddOn.cpp 
b/src/add-ons/disk_systems/intel/PartitionMapAddOn.cpp
index 4dc6b2a..f4cbb0a 100644
--- a/src/add-ons/disk_systems/intel/PartitionMapAddOn.cpp
+++ b/src/add-ons/disk_systems/intel/PartitionMapAddOn.cpp
@@ -90,8 +90,10 @@ PartitionMapAddOn::CreatePartitionHandle(BMutablePartition* 
partition,
 bool
 PartitionMapAddOn::CanInitialize(const BMutablePartition* partition)
 {
-       // If it's big enough, we can initialize it.
-       return partition->Size() >= 2 * partition->BlockSize();
+       // If it's big enough, but not too big (ie. larger than 2^32 blocks) we 
can
+       // initialize it.
+       return partition->Size() >= 2 * partition->BlockSize()
+               && partition->Size() / partition->BlockSize() < UINT32_MAX;
 }
 
 

############################################################################

Revision:    hrev45192
Commit:      99fc216a95a1db7b9b2ab905e9ee6af4baccc201
URL:         http://cgit.haiku-os.org/haiku/commit/?id=99fc216
Author:      Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
Date:        Wed Jan 23 23:45:50 2013 UTC

gpt: do not advertize the partition as read-only.

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

diff --git a/src/add-ons/kernel/partitioning_systems/gpt/efi_gpt.cpp 
b/src/add-ons/kernel/partitioning_systems/gpt/efi_gpt.cpp
index 4041cfe1..33fcede 100644
--- a/src/add-ons/kernel/partitioning_systems/gpt/efi_gpt.cpp
+++ b/src/add-ons/kernel/partitioning_systems/gpt/efi_gpt.cpp
@@ -459,7 +459,7 @@ efi_gpt_scan_partition(int fd, partition_data *partition, 
void *_cookie)
        EFI::Header *header = (EFI::Header *)_cookie;
 
        partition->status = B_PARTITION_VALID;
-       partition->flags |= B_PARTITION_PARTITIONING_SYSTEM | 
B_PARTITION_READ_ONLY;
+       partition->flags |= B_PARTITION_PARTITIONING_SYSTEM;
        partition->content_size = partition->size;
        partition->content_cookie = header;
 


Other related posts:

  • » [haiku-commits] haiku: hrev45192 - in src/add-ons: disk_systems/intel kernel/partitioning_systems/gpt - axeld