summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhillip Susi <psusi@ubuntu.com>2014-04-27 11:15:47 -0400
committerPhillip Susi <psusi@ubuntu.com>2014-05-22 19:56:36 -0400
commit7feb3b452c5ae57e75e16f8c00f46c9aa564a4cc (patch)
treea6d4d1a1d960c537cddc1b3b9cdf653fcd1e2098
parent32d637298717446a4edd3c8fbe637462fab4c000 (diff)
downloadparted-7feb3b452c5ae57e75e16f8c00f46c9aa564a4cc.tar.gz
libparted: don't create partition on loop label
The loop label represents an unpartitioned disk, but creates a dummy partition to represent the whole disk. This dummy partition was actually being loaded into the kernel. Don't do that.
-rw-r--r--NEWS4
-rw-r--r--libparted/arch/linux.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 8ec11ab..7d7edd8 100644
--- a/NEWS
+++ b/NEWS
@@ -29,6 +29,10 @@ GNU parted NEWS -*- outline -*-
** Bug Fixes
+ libparted: The loop label represents an unpartitioned disk, but creates
+ a dummy partition to represent the whole disk. This dummy partition
+ was actually being loaded into the kernel. Don't do that.
+
libparted: fix loop labels to not vanish if you don't create
a filesystem, and to not return an error syncing when you do.
diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index 4cbe49b..9ae6d64 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -2883,6 +2883,9 @@ _disk_sync_part_table (PedDisk* disk)
lpn = PED_MIN(lpn, part_range);
else
lpn = part_range;
+ /* don't actually add partitions for loop */
+ if (strcmp (disk->type->name, "loop") == 0)
+ lpn = 0;
for (i = 1; i <= lpn; i++) {
PedPartition *part = ped_disk_get_partition (disk, i);
if (!part)