]> git.ipfire.org Git - thirdparty/mdadm.git/commit - util.c
Use disk sector size value to set offset for reading GPT
authorMariusz Dabrowski <mariusz.dabrowski@intel.com>
Thu, 8 Dec 2016 11:13:15 +0000 (12:13 +0100)
committerJes Sorensen <Jes.Sorensen@redhat.com>
Mon, 12 Dec 2016 19:26:22 +0000 (14:26 -0500)
commit41b06495ba3c6da9bddef7ae89c2c633c4c21c5c
treedd3740573d3037a4b715f8cd51bcaac07a3c640e
parentb7d81a38c7be8019ceb812071021f0564bc61795
Use disk sector size value to set offset for reading GPT

mdadm is using invalid byte-offset while reading GPT header to get
partition info (size, first sector, last sector etc.). Now this offset
is hardcoded to 512 bytes and it is not valid for disks with sector
size different than 512 bytes because MBR and GPT headers are aligned
to LBA, so valid offset for 4k drives is 4096 bytes.

Signed-off-by: Mariusz Dabrowski <mariusz.dabrowski@intel.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
super-gpt.c
util.c