mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zipl: fix reading 4k disk's geometry
On 4k SCSI disks zipl stores wrong values to 'scsi_mbr.program_table_pointer', which makes system unbootable. This happens in 'zipl/src/disk.c:656': ``` /* Convert file system block to physical */ *physical = mapped * phy_per_fs + subblock; /* Add partition start */ *physical += info->geo.start; ``` So 'hd_geometry.start' should be adjusted before being used. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1918723 Closes: https://github.com/ibm-s390-linux/s390-tools/pull/107 Signed-off-by: Nikita Dubrovskii <nikita@linux.ibm.com> Reviewed-by: Stefan Haberland <sth@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
e506c94839
commit
4a3957fab5
@@ -444,6 +444,9 @@ type_determined:
|
||||
}
|
||||
/* Convert device size to size in physical blocks */
|
||||
data->phy_blocks = devsize / (data->phy_block_size / 512);
|
||||
/* Adjust start on SCSI according to block_size. device-mapper devices are skipped */
|
||||
if (data->type == disk_type_scsi && target->targetbase == NULL)
|
||||
data->geo.start = data->geo.start / (data->phy_block_size / 512);
|
||||
if (data->partnum != 0)
|
||||
data->partition = stats.st_rdev;
|
||||
/* Try to get device name */
|
||||
|
||||
Reference in New Issue
Block a user