From e4785bbb25781c27b89c735478f4a8b0b7ea8180 Mon Sep 17 00:00:00 2001
From: louhongxiang <louhongxiang@huawei.com>
Date: Sun, 17 Mar 2019 21:29:49 -0400
Subject: [PATCH] parted: fix failure of mklabel gpt_sync_mbr.

reason:fix failure of mklabel gpt_sync_mbr.

Signed-off-by: louhongxiang <louhongxiang@huawei.com>
---
 libparted/labels/gpt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c
index d94add1..6e7bbf2 100644
--- a/libparted/labels/gpt.c
+++ b/libparted/labels/gpt.c
@@ -630,6 +630,7 @@ gpt_sync_mbr_alloc (const PedDevice *dev)
   data_start = 2 + GPT_DEFAULT_PARTITION_ENTRY_ARRAY_SIZE / dev->sector_size;
   data_end = dev->length - 2
     - GPT_DEFAULT_PARTITION_ENTRY_ARRAY_SIZE / dev->sector_size;
+  gpt_disk_data->AlternateLBA = dev->length - 1;
   ped_geometry_init (&gpt_disk_data->data_area, dev, data_start,
                      data_end - data_start + 1);
   gpt_disk_data->entry_count = GPT_DEFAULT_PARTITION_ENTRIES;
-- 
1.8.3.1

