[haiku-bugs] Re: [Haiku] #8990: intel partiton addon allows creating partitions > 2TB (easy)

  • From: "pdziepak" <trac@xxxxxxxxxxxx>
  • Date: Mon, 26 Jan 2015 09:47:05 -0000

#8990: intel partiton addon allows creating partitions > 2TB (easy)
------------------------------------------+----------------------------
   Reporter:  luroh                       |      Owner:  bonefish
       Type:  bug                         |     Status:  new
   Priority:  normal                      |  Milestone:  R1
  Component:  Partitioning Systems/Intel  |    Version:  R1/Development
 Resolution:                              |   Keywords:
 Blocked By:                              |   Blocking:
Has a Patch:  1                           |   Platform:  All
------------------------------------------+----------------------------

Comment (by pdziepak):

 1. This patch assumes sector size to be 512 which may not be true (e.g.
 4Kn).
 2. What was wrong with `partition->Size() / partition->BlockSize() <
 UINT32_MAX` ?
 3. The part with B_BAD_VALUE checks is unrelated and should be in a
 separate patch.
 4. Personally, I really hate redundant code and while (unfortunately)
 explicit checks like `foo == NULL` are encouraged by the coding guidelines
 there are also way too many parentheses in your patch. What about `if
 (!CanInitialize(partition) || parameters == NULL || parameters[0] ==
 '\0')` ? Splitting that conditional into three ifs (one for
 `CanInitialize()`, one for `name` and one for `parameters`) also may be a
 good idea.

--
Ticket URL: <https://dev.haiku-os.org/ticket/8990#comment:6>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: