From: Matt Porter <matt.porter@linaro.org>
To: Davidlohr Bueso <davidlohr@hp.com>
Cc: Karel Zak <kzak@redhat.com>,
Matt Fleming <matt.fleming@intel.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
torvalds@linux-foundation.org
Subject: Re: GPT detection regression in efi.c from commit 27a7c64
Date: Fri, 13 Sep 2013 14:33:30 -0400 [thread overview]
Message-ID: <52335A7A.6000406@linaro.org> (raw)
In-Reply-To: <1379096972.2197.31.camel@buesod1.americas.hpqcorp.net>
On 09/13/2013 02:29 PM, Davidlohr Bueso wrote:
> On Fri, 2013-09-13 at 20:17 +0200, Karel Zak wrote:
>> On Fri, Sep 13, 2013 at 02:09:55PM -0400, Matt Porter wrote:
>>>> Come to think of it, we do have a long existing workaround: the
>>>> force_gpt option. Setting it will bypass any MBR checking
>>>> (is_pmbr_valid(), specifically).
>>>
>>> Yes, that's what I used at first after seeing what the problem was. But then
>>> I opted to fix my PMBR.
>>>
>>> I felt like it was a regression since it required a new option passed on the
>>> cmdline.
>>
>> Yep, it is *regression* and I guess Davidlohr is going to fix it asap :-)
>
> I was doing a git revert, but what would you guys think of keeping the
> check but making it more flexible? Instead of enforcing the minimum,
> just make sure that the size_in_lba is either the whole disk or 2 TiB,
> that should take care of Matt's issue.
That seems to be the way to go given the departure from the spec.
> diff --git a/block/partitions/efi.c b/block/partitions/efi.c
> index 1a5ec9a..df2fca1 100644
> --- a/block/partitions/efi.c
> +++ b/block/partitions/efi.c
> @@ -220,8 +220,8 @@ check_hybrid:
> * Hybrid MBRs do not necessarily comply with this.
> */
> if (ret == GPT_MBR_PROTECTIVE) {
> - if (le32_to_cpu(mbr->partition_record[part].size_in_lba) !=
> - min((uint32_t) total_sectors - 1, 0xFFFFFFFF))
> + if (le32_to_cpu(mbr->partition_record[part].size_in_lba) != (uint32_t) total_sectors - 1 ||
> + le32_to_cpu(mbr->partition_record[part].size_in_lba) != 0xFFFFFFFF)
> ret = 0;
> }
> done:
>
> Karel, I guess any changes that we do here should apply to fdisk :)
>
> Thanks,
> Davidlohr
>
next prev parent reply other threads:[~2013-09-13 18:33 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-13 14:50 GPT detection regression in efi.c from commit 27a7c64 Matt Porter
2013-09-13 16:28 ` Davidlohr Bueso
2013-09-13 17:01 ` Matt Porter
2013-09-13 17:37 ` Davidlohr Bueso
2013-09-13 18:17 ` Matt Porter
2013-09-13 18:07 ` Davidlohr Bueso
2013-09-13 18:09 ` Matt Porter
2013-09-13 18:17 ` Karel Zak
2013-09-13 18:29 ` Davidlohr Bueso
2013-09-13 18:33 ` Matt Porter [this message]
2013-09-13 19:26 ` Davidlohr Bueso
2013-09-13 21:36 ` Matt Porter
2013-09-13 22:02 ` Davidlohr Bueso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52335A7A.6000406@linaro.org \
--to=matt.porter@linaro.org \
--cc=davidlohr@hp.com \
--cc=kzak@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matt.fleming@intel.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox