Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1501855

[PATCH] partitions/efi: Ignore errors when alternate GPT is not at the end of disk

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Hannes Reinecke <hare@suse.de>
Newsgroups linux.kernel
Subject [PATCH] partitions/efi: Ignore errors when alternate GPT is not at the end of disk
Date Mon, 17 Oct 2016 12:30:01 +0200
Message-ID <stdl7-2ek-1@gated-at.bofh.it> (permalink)
X-Original-To Davidlohr Bueso <dbueso@suse.com>
X-Mailer git-send-email 1.8.5.6
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 42
Organization linux.* mail to news gateway
X-Original-Cc Jens@suse.de, "Axboe <axboe"@kernel.dk, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, Hannes Reinecke <hare@suse.de>, Hannes Reinecke <hare@suse.com>
X-Original-Date Mon, 17 Oct 2016 12:20:30 +0200
X-Original-Message-ID <1476699630-127009-1-git-send-email-hare@suse.de>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1501855

Show key headers only | View raw


The GPT specification requires that the alternate GPT is at the
end of the disk. However, if a Software RAID1 is enabled the RAID
metadata typically placed at the end of the disk, and the actual
size of the disk is decreased by the size of the metadata.
Plus it's perfectly legit to have a partition table which is
_smaller_ than the device; eg we don't check for the device
size in the msdos partition, neither.
So don't print out a warning here.

Signed-off-by: Hannes Reinecke <hare@suse.com>
---
 block/partitions/efi.c | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/block/partitions/efi.c b/block/partitions/efi.c
index bcd86e5..011faa7 100644
--- a/block/partitions/efi.c
+++ b/block/partitions/efi.c
@@ -550,21 +550,6 @@ static int is_gpt_valid(struct parsed_partitions *state, u64 lba,
 		       le32_to_cpu(agpt->partition_entry_array_crc32));
 		error_found++;
 	}
-	if (le64_to_cpu(pgpt->alternate_lba) != lastlba) {
-		pr_warn("GPT:Primary header thinks Alt. header is not at the end of the disk.\n");
-		pr_warn("GPT:%lld != %lld\n",
-			(unsigned long long)le64_to_cpu(pgpt->alternate_lba),
-			(unsigned long long)lastlba);
-		error_found++;
-	}
-
-	if (le64_to_cpu(agpt->my_lba) != lastlba) {
-		pr_warn("GPT:Alternate GPT header not at the end of the disk.\n");
-		pr_warn("GPT:%lld != %lld\n",
-			(unsigned long long)le64_to_cpu(agpt->my_lba),
-			(unsigned long long)lastlba);
-		error_found++;
-	}
 
 	if (error_found)
 		pr_warn("GPT: Use GNU Parted to correct GPT errors.\n");
-- 
1.8.5.6

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] partitions/efi: Ignore errors when alternate GPT is not at the end of disk Hannes Reinecke <hare@suse.de> - 2016-10-17 12:30 +0200
  Re: [PATCH] partitions/efi: Ignore errors when alternate GPT is not  at the end of disk Karel Zak <kzak@redhat.com> - 2016-10-18 12:00 +0200
    Re: [PATCH] partitions/efi: Ignore errors when alternate GPT is not  at the end of disk Hannes Reinecke <hare@suse.com> - 2016-10-18 12:10 +0200

csiph-web