c6a1bfceda
- tests: Set optimal blocks to 64 for scsi_debug devices (bcl) - tests: t3310-flags.sh: Add tests for remaining table types (mike.fleetwood) - tests: t3310-flags.sh: Add test for dvh table flags (mike.fleetwood) - tests: t3310-flags.sh: Add test for mac table flags (mike.fleetwood) - libparted: Remove commented local variable from bsd_partition_set_flag() (mike.fleetwood) - libparted: Fix to report success when setting lvm flag on bsd table (mike.fleetwood) - tests: t3310-flags.sh: Add test for bsd table flags (mike.fleetwood) - tests: t3310-flags.sh: Stop excluding certain flags from being tested (mike.fleetwood) - tests: t3310-flags.sh: Query libparted for all flags to be tested (mike.fleetwood) - libparted: only IEC units are treated as exact (petr.uzel) - docs: Improve partition description in parted.texi (gareth.randall) - Add support for NVMe devices (petr.uzel) - libparted/dasd: correct the offset where the first partition begins (dongdwdw)
55 lines
2.1 KiB
Diff
55 lines
2.1 KiB
Diff
From 40270928ff4ac2a87825f47e53c680ffb18b5bc4 Mon Sep 17 00:00:00 2001
|
|
From: Wang Dong <dongdwdw@linux.vnet.ibm.com>
|
|
Date: Tue, 14 Jun 2016 12:19:40 +0200
|
|
Subject: [PATCH 41/53] libparted/dasd: correct the offset where the first
|
|
partition begins
|
|
|
|
The start point of first partition must start at least from the third
|
|
track of DASD, due to the existence of metadata in the first two track.
|
|
The previous constraint just sets all the device to be partitioned.
|
|
So when the start point of the first partition start before the third
|
|
track, (For example if it starts from.0) parted will exit abruptly.
|
|
And this kind of job must be done with constraint explicitly.
|
|
|
|
Then the constraint is modified to exclude the first two tracks and
|
|
to make the first partition start from the third track by default.
|
|
|
|
Signed-off-by: Wang Dong <dongdwdw@linux.vnet.ibm.com>
|
|
Reviewed-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
|
|
Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
|
|
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
(cherry picked from commit 4126d0292c75cf7d50a2f4e9d485a52b5beafccc)
|
|
---
|
|
libparted/labels/dasd.c | 8 +++++++-
|
|
1 file changed, 7 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/libparted/labels/dasd.c b/libparted/labels/dasd.c
|
|
index f79a867..4e68512 100644
|
|
--- a/libparted/labels/dasd.c
|
|
+++ b/libparted/labels/dasd.c
|
|
@@ -829,6 +829,7 @@ _primary_constraint (PedDisk* disk)
|
|
PedSector sector_size;
|
|
LinuxSpecific* arch_specific;
|
|
DasdDiskSpecific* disk_specific;
|
|
+ PedSector start;
|
|
|
|
PDEBUG;
|
|
|
|
@@ -842,7 +843,12 @@ _primary_constraint (PedDisk* disk)
|
|
if (!ped_alignment_init (&end_align, -1,
|
|
disk->dev->hw_geom.sectors * sector_size))
|
|
return NULL;
|
|
- if (!ped_geometry_init (&max_geom, disk->dev, 0, disk->dev->length))
|
|
+
|
|
+ start = (FIRST_USABLE_TRK * (long long) disk->dev->hw_geom.sectors
|
|
+ * (long long) arch_specific->real_sector_size
|
|
+ / (long long) disk->dev->sector_size);
|
|
+
|
|
+ if (!ped_geometry_init (&max_geom, disk->dev, start, disk->dev->length))
|
|
return NULL;
|
|
|
|
return ped_constraint_new(&start_align, &end_align, &max_geom,
|
|
--
|
|
2.7.4
|
|
|