From: Andrew Morton <akpm@linux-foundation.org>
To: Artem Bityutskiy <dedekind1@gmail.com>
Cc: Davidlohr Bueso <davidlohr@hp.com>,
Matt Fleming <matt.fleming@intel.com>,
Artem Bityutskiy <artem.bityutskiy@linux.intel.com>,
Karel Zak <kzak@redhat.com>,
Linux Kernel Maling List <linux-kernel@vger.kernel.org>,
Doug Anderson <dianders@chromium.org>
Subject: Re: [PATCH 2/2 for 3.12-rc6] Revert "partitions/efi: account for pmbr size in lba"
Date: Mon, 14 Oct 2013 11:26:42 -0700 [thread overview]
Message-ID: <20131014112642.8efe63022ea05b07ced7fad8@linux-foundation.org> (raw)
In-Reply-To: <1381750909-20082-2-git-send-email-dedekind1@gmail.com>
On Mon, 14 Oct 2013 14:41:49 +0300 Artem Bityutskiy <dedekind1@gmail.com> wrote:
> This reverts commit 27a7c642174eaec627f6a3a254035bf8abd02c5e.
>
> This patch breaks existing systems, for example, Tizen IVI images do not boot
> the way they have always been booted because of this patch.
Does Doug's patch fix this?
From: Doug Anderson <dianders@chromium.org>
Subject: block/partitions/efi.c: treat size mismatch as a warning, not an error
In 27a7c64 ("partitions/efi: account for pmbr size in lba") we started
treating bad sizes in lba field of the partition that has the 0xEE (GPT
protective) as errors. However, we may run into these "bad sizes" in the
real world if someone uses dd to copy an image from a smaller disk to a
bigger disk. Since this case used to work (even without using force_gpt),
keep it working and treat the size mismatch as a warning instead of an
error.
Reported-by: Josh Triplett <josh@joshtriplett.org>
Reported-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Acked-by: Davidlohr Bueso <davidlohr@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
block/partitions/efi.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff -puN block/partitions/efi.c~block-partitions-efic-treat-size-mismatch-as-a-warning-not-an-error block/partitions/efi.c
--- a/block/partitions/efi.c~block-partitions-efic-treat-size-mismatch-as-a-warning-not-an-error
+++ a/block/partitions/efi.c
@@ -222,11 +222,16 @@ check_hybrid:
* the disk size.
*
* Hybrid MBRs do not necessarily comply with this.
+ *
+ * Consider a bad value here to be a warning to support dd'ing
+ * an image from a smaller disk to a larger disk.
*/
if (ret == GPT_MBR_PROTECTIVE) {
sz = le32_to_cpu(mbr->partition_record[part].size_in_lba);
if (sz != (uint32_t) total_sectors - 1 && sz != 0xFFFFFFFF)
- ret = 0;
+ pr_debug("GPT: mbr size in lba (%u) different than whole disk (%u).\n",
+ sz, min_t(uint32_t,
+ total_sectors - 1, 0xFFFFFFFF));
}
done:
return ret;
_
next prev parent reply other threads:[~2013-10-14 18:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-14 11:41 [PATCH 1/2 for 3.12-rc6] Revert "partitions/efi: loosen check fot " Artem Bityutskiy
2013-10-14 11:41 ` [PATCH 2/2 for 3.12-rc6] Revert "partitions/efi: account for " Artem Bityutskiy
2013-10-14 18:26 ` Andrew Morton [this message]
2013-10-15 10:22 ` Artem Bityutskiy
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=20131014112642.8efe63022ea05b07ced7fad8@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=artem.bityutskiy@linux.intel.com \
--cc=davidlohr@hp.com \
--cc=dedekind1@gmail.com \
--cc=dianders@chromium.org \
--cc=kzak@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matt.fleming@intel.com \
/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
Powered by JetHome