]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libfdisk: allow to change an existing extended partition
authorPavel Butsykin <pbutsykin@virtuozzo.com>
Tue, 18 Apr 2017 15:59:18 +0000 (18:59 +0300)
committerKarel Zak <kzak@redhat.com>
Wed, 19 Apr 2017 08:25:39 +0000 (10:25 +0200)
Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com>
libfdisk/src/dos.c

index 39e42e3e6c89b6b2e4febfb8e24aa6e5c34ec74e..8f54f7369e049587ca10b0880518eeeea7e7631c 100644 (file)
@@ -2025,7 +2025,7 @@ static int dos_set_partition(struct fdisk_context *cxt, size_t n,
        orgtype = p->sys_ind;
 
        if (pa->type) {
-               if (IS_EXTENDED(pa->type->code) && l->ext_offset) {
+               if (IS_EXTENDED(pa->type->code) && l->ext_offset && l->ext_index != n) {
                        fdisk_warnx(cxt, _("Extended partition already exists."));
                        return -EINVAL;
                }