bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC/PATCH 1/2] dasd: take sector size into account when calculating sta


From: Jonathan Nieder
Subject: [RFC/PATCH 1/2] dasd: take sector size into account when calculating starting block
Date: Fri, 16 Apr 2010 22:48:32 -0500
User-agent: Mutt/1.5.20 (2009-06-14)

From: Stephen Powell <address@hidden>

Fix a bug in which the starting block of the partition is incorrectly
calculated for LDL disks if the block size is not 4906.

In the old Linux Disk Layout, there is a single implicit partition on
the disk.  The first two physical blocks on the disk (for a CKD DASD
device) are IPL records.  The third physical block is the volume
label.  The implicit partition begins with the fourth physical block
and extends to the end of the disk.

This is an s390-specific fix.

Signed-off-by: Jonathan Nieder <address@hidden>
---
 NEWS                    |    4 ++++
 libparted/labels/dasd.c |    3 ++-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/NEWS b/NEWS
index c5c2182..4735990 100644
--- a/NEWS
+++ b/NEWS
@@ -23,6 +23,10 @@ GNU parted NEWS                                    -*- 
outline -*-
   libparted uses a more accurate heuristic to distinguish between
   ext4 and ext3 partitions.
 
+  dasd: The starting block for disks with the old Linux Disk Layout has
+  been corrected to take the block size into account.  This allows
+  DASDs with block sizes other than 4096 to be used.
+
 ** Changes in behavior
 
   libparted no longer issues an exception/warning about >512-byte
diff --git a/libparted/labels/dasd.c b/libparted/labels/dasd.c
index 275a55a..1b29fcf 100644
--- a/libparted/labels/dasd.c
+++ b/libparted/labels/dasd.c
@@ -292,7 +292,8 @@ dasd_read (PedDisk* disk)
 
                /* LDL format, old one */
                disk_specific->format_type = 1;
-               start = 24;
+               start = (long long) arch_specific->real_sector_size
+                       / (long long)disk->dev->sector_size * 3;
                end = (long long)(long long) anchor.geo.cylinders
                      * (long long)anchor.geo.heads
                      * (long long)disk->dev->hw_geom.sectors
-- 
1.7.1.rc1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]