diff options
author | Karel Zak | 2017-06-19 11:41:02 +0200 |
---|---|---|
committer | Karel Zak | 2017-06-19 11:41:02 +0200 |
commit | ee9ba4fa5ec8b51fa300e9369d5993b2eab3182d (patch) | |
tree | 356071ef3924be5e266aa95e733837215418fdc0 /libfdisk/src/dos.c | |
parent | Merge branch 'some-fixes' of https://github.com/rudimeier/util-linux (diff) | |
download | kernel-qcow2-util-linux-ee9ba4fa5ec8b51fa300e9369d5993b2eab3182d.tar.gz kernel-qcow2-util-linux-ee9ba4fa5ec8b51fa300e9369d5993b2eab3182d.tar.xz kernel-qcow2-util-linux-ee9ba4fa5ec8b51fa300e9369d5993b2eab3182d.zip |
libfdisk: (dos) fix primary/logical logic when follow template
This stupid bug has been introduced by e1cfb304 (v2.30) and it
disables to create extended partition by cfdisk :-(
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libfdisk/src/dos.c')
-rw-r--r-- | libfdisk/src/dos.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libfdisk/src/dos.c b/libfdisk/src/dos.c index 0494c44c4..73660d8ce 100644 --- a/libfdisk/src/dos.c +++ b/libfdisk/src/dos.c @@ -1580,7 +1580,7 @@ static int dos_add_partition(struct fdisk_context *cxt, } /* pa specifies start, but outside extended partition */ - } else if (pa && fdisk_partition_has_start(pa)) { + } else if (pa && fdisk_partition_has_start(pa) && l->ext_offset) { DBG(LABEL, ul_debug("DOS: pa template %p: add primary", pa)); rc = get_partition_unused_primary(cxt, pa, &res); if (rc == 0) @@ -1590,7 +1590,7 @@ static int dos_add_partition(struct fdisk_context *cxt, /* pa follows default, but partno < 4, it means primary partition */ } else if (pa && fdisk_partition_start_is_default(pa) && fdisk_partition_has_partno(pa) - && pa->partno < 4) { + && pa->partno < 4) { DBG(LABEL, ul_debug("DOS: pa template %p: add primary (partno < 4)", pa)); rc = get_partition_unused_primary(cxt, pa, &res); if (rc == 0) |