mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Davidlohr Bueso <davidlohr@hp.com>,
	Matt Fleming <matt.fleming@intel.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>,
	Karel Zak <kzak@redhat.com>,
	Linux Kernel Maling List <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/2 for 3.12-rc6] Revert "partitions/efi: loosen check fot pmbr size in lba"
Date: Mon, 14 Oct 2013 14:41:48 +0300	[thread overview]
Message-ID: <1381750909-20082-1-git-send-email-dedekind1@gmail.com> (raw)

From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>

This reverts commit 6b02fa59a7cf34c548eedee657b07ea6c54d3894.

This commit is fixing a commit which is going to be reverted. So revert this
one too since it becomes unneeded.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
---
 block/partitions/efi.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/block/partitions/efi.c b/block/partitions/efi.c
index 1eb09ee..1a5ec9a 100644
--- a/block/partitions/efi.c
+++ b/block/partitions/efi.c
@@ -186,7 +186,6 @@ invalid:
  */
 static int is_pmbr_valid(legacy_mbr *mbr, sector_t total_sectors)
 {
-	uint32_t sz = 0;
 	int i, part = 0, ret = 0; /* invalid by default */
 
 	if (!mbr || le16_to_cpu(mbr->signature) != MSDOS_MBR_SIGNATURE)
@@ -217,15 +216,12 @@ check_hybrid:
 	/*
 	 * Protective MBRs take up the lesser of the whole disk
 	 * or 2 TiB (32bit LBA), ignoring the rest of the disk.
-	 * Some partitioning programs, nonetheless, choose to set
-	 * the size to the maximum 32-bit limitation, disregarding
-	 * the disk size.
 	 *
 	 * Hybrid MBRs do not necessarily comply with this.
 	 */
 	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)
+		if (le32_to_cpu(mbr->partition_record[part].size_in_lba) !=
+		    min((uint32_t) total_sectors - 1, 0xFFFFFFFF))
 			ret = 0;
 	}
 done:
-- 
1.8.1.4


             reply	other threads:[~2013-10-14 11:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-14 11:41 Artem Bityutskiy [this message]
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
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=1381750909-20082-1-git-send-email-dedekind1@gmail.com \
    --to=dedekind1@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=artem.bityutskiy@linux.intel.com \
    --cc=davidlohr@hp.com \
    --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