summaryrefslogtreecommitdiffstats
path: root/libfdisk
diff options
context:
space:
mode:
authorKarel Zak2017-04-06 13:04:09 +0200
committerKarel Zak2017-04-06 13:04:09 +0200
commitbbb574a2938fbd05ce5aae3fd0456b0f5d959360 (patch)
tree183c730290918b9c759da0fab48dd2d940050e76 /libfdisk
parentfincore: use size_t everywhere (diff)
downloadkernel-qcow2-util-linux-bbb574a2938fbd05ce5aae3fd0456b0f5d959360.tar.gz
kernel-qcow2-util-linux-bbb574a2938fbd05ce5aae3fd0456b0f5d959360.tar.xz
kernel-qcow2-util-linux-bbb574a2938fbd05ce5aae3fd0456b0f5d959360.zip
libfdisk: (gpt) update nparts_max
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libfdisk')
-rw-r--r--libfdisk/src/gpt.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libfdisk/src/gpt.c b/libfdisk/src/gpt.c
index 36198c3bd..092954f11 100644
--- a/libfdisk/src/gpt.c
+++ b/libfdisk/src/gpt.c
@@ -2678,6 +2678,9 @@ int fdisk_gpt_set_npartitions(struct fdisk_context *cxt, uint32_t entries)
gpt_recompute_crc(gpt->pheader, gpt->ents);
gpt_recompute_crc(gpt->bheader, gpt->ents);
+ /* update library info */
+ cxt->label->nparts_max = gpt_get_nentries(gpt);
+
fdisk_info(cxt, _("Partition table length changed from %"PRIu32" to %"PRIu64"."), old, entries);
fdisk_label_set_changed(cxt->label, 1);