]>
Commit | Line | Data |
---|---|---|
289c5516 MT |
1 | --- |
2 | kpartx/gpt.c | 9 ++++++--- | |
3 | 1 file changed, 6 insertions(+), 3 deletions(-) | |
4 | ||
5 | Index: multipath-tools-120821/kpartx/gpt.c | |
6 | =================================================================== | |
7 | --- multipath-tools-120821.orig/kpartx/gpt.c | |
8 | +++ multipath-tools-120821/kpartx/gpt.c | |
9 | @@ -637,6 +637,7 @@ read_gpt_pt (int fd, struct slice all, s | |
10 | uint32_t i; | |
11 | int n = 0; | |
12 | int last_used_index=-1; | |
13 | + int sector_size_mul = get_sector_size(fd)/512; | |
14 | ||
15 | if (!find_valid_gpt (fd, &gpt, &ptes) || !gpt || !ptes) { | |
16 | if (gpt) | |
17 | @@ -652,9 +653,11 @@ read_gpt_pt (int fd, struct slice all, s | |
18 | sp[n].size = 0; | |
19 | n++; | |
20 | } else { | |
21 | - sp[n].start = __le64_to_cpu(ptes[i].starting_lba); | |
22 | - sp[n].size = __le64_to_cpu(ptes[i].ending_lba) - | |
23 | - __le64_to_cpu(ptes[i].starting_lba) + 1; | |
24 | + sp[n].start = sector_size_mul * | |
25 | + __le64_to_cpu(ptes[i].starting_lba); | |
26 | + sp[n].size = sector_size_mul * | |
27 | + (__le64_to_cpu(ptes[i].ending_lba) - | |
28 | + __le64_to_cpu(ptes[i].starting_lba) + 1); | |
29 | last_used_index=n; | |
30 | n++; | |
31 | } |