From: akpm@linux-foundation.org Subject: + block-partitions-efic-treat-size-mismatch-as-a-warning-not-an-error.patch added to -mm tree Date: Fri, 11 Oct 2013 11:37:13 -0700 Message-ID: <52584559.ZMLwnJA4p5rcGCLd%akpm@linux-foundation.org> Reply-To: linux-kernel@vger.kernel.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from mail.linuxfoundation.org ([140.211.169.12]:44570 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751846Ab3JKShO (ORCPT ); Fri, 11 Oct 2013 14:37:14 -0400 Sender: mm-commits-owner@vger.kernel.org List-Id: mm-commits@vger.kernel.org To: mm-commits@vger.kernel.org, seanpaul@chromium.org, josh@joshtriplett.org, davidlohr@hp.com, dianders@chromium.org Subject: + block-partitions-efic-treat-size-mismatch-as-a-warning-not-an-error.patch added to -mm tree To: dianders@chromium.org,davidlohr@hp.com,josh@joshtriplett.org,seanpaul@chromium.org From: akpm@linux-foundation.org Date: Fri, 11 Oct 2013 11:37:13 -0700 The patch titled Subject: block/partitions/efi.c: treat size mismatch as a warning, not an error has been added to the -mm tree. Its filename is block-partitions-efic-treat-size-mismatch-as-a-warning-not-an-error.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/block-partitions-efic-treat-size-mismatch-as-a-warning-not-an-error.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/block-partitions-efic-treat-size-mismatch-as-a-warning-not-an-error.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Doug Anderson 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 Reported-by: Sean Paul Signed-off-by: Doug Anderson Reviewed-by: Josh Triplett Acked-by: Davidlohr Bueso Signed-off-by: Andrew Morton --- 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; _ Patches currently in -mm which might be from dianders@chromium.org are block-partitions-efic-treat-size-mismatch-as-a-warning-not-an-error.patch linux-next.patch