• Matt Domsch's avatar
    [PATCH] EFI GPT: reduce alternate header probing · 4e11ea7a
    Matt Domsch authored
    EFI partitioning scheme was reading the last reported sector of the
    block device to look for the alternate GPT header, before it had
    confirmed that it should.  This causes problems for devices with the
    following problems:  a) those who misreport their size (typically
    off-by-one), and b) those who fail when asked to read a block
    outside their range.
    
    This patch moves the test for the Protective Master Boot Record (PMBR)
    ahead of the tests for the Primary and Alternate GPT headers.  If the
    PMBR is not valid, the disk is assumed to not be a GPT disk.  This can
    be overridden with the 'gpt' kernel command line option.  If the
    Primary GPT header is not valid, the Alternate GPT header is not
    probed automatically unless the 'gpt' kernel command line option is
    passed.  If the both the PMBR and Primary GPT header are valid, then
    the Alternate GPT header at the end of the disk is probed.
    
    Also re-enables CONFIG_EFI_PARTITION for all architectures.
    Signed-off-by: default avatarMatt Domsch <Matt_Domsch@dell.com>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    4e11ea7a
efi.c 19.6 KB