From: Karel Zak Date: Tue, 4 Dec 2012 17:03:35 +0000 (+0100) Subject: fdisk: (gpt) check if the "First sector" is unused X-Git-Tag: v2.23-rc1~449 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=e3443e8f19c2c7cdb23c2815c7565e8e24101e1b;p=thirdparty%2Futil-linux.git fdisk: (gpt) check if the "First sector" is unused Signed-off-by: Karel Zak --- diff --git a/fdisks/gpt.c b/fdisks/gpt.c index a222002721..9963315d9b 100644 --- a/fdisks/gpt.c +++ b/fdisks/gpt.c @@ -1530,7 +1530,12 @@ static int gpt_add_partition(struct fdisk_context *cxt, int partnum, 0, _("First sector")); if (user_f < disk_f || user_f > disk_l) + continue; /* bug in read_int() dialog? */ + + if (user_f != find_first_available(pheader, ents, user_f)) { + printf(_("Sector %ju already used\n"), user_f); continue; + } /* Last sector */ dflt_l = find_last_free(pheader, ents, user_f);