[syslinux:master] diskio: when falling back EDD->CHS make sure to get the offset right

syslinux-bot for H. Peter Anvin hpa at linux.intel.com
Fri Jul 16 16:30:03 PDT 2010


Commit-ID:  21af78ff343844210a2241daa1b040c9d3c72178
Gitweb:     http://syslinux.zytor.com/commit/21af78ff343844210a2241daa1b040c9d3c72178
Author:     H. Peter Anvin <hpa at linux.intel.com>
AuthorDate: Fri, 16 Jul 2010 16:24:08 -0700
Committer:  H. Peter Anvin <hpa at linux.intel.com>
CommitDate: Fri, 16 Jul 2010 16:24:08 -0700

diskio: when falling back EDD->CHS make sure to get the offset right

When we decide to go from EDD to CHS, make sure we convert from
absolute back to a partition offset.  The cylinder check should still
be on the absolute value, however.

Signed-off-by: H. Peter Anvin <hpa at linux.intel.com>


---
 core/fs/diskio.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/core/fs/diskio.c b/core/fs/diskio.c
index df40c4a..822314c 100644
--- a/core/fs/diskio.c
+++ b/core/fs/diskio.c
@@ -226,7 +226,8 @@ static int edd_rdwr_sectors(struct disk *disk, void *buf,
 	     * assume that for now.
 	     */
 	    if (lba < ((disk->h * disk->s) << 10)) {
-		done = chs_rdwr_sectors(disk, buf, lba, count, is_write);
+		done = chs_rdwr_sectors(disk, buf, lba - disk->part_start,
+					count, is_write);
 		if (done == (count << sector_shift)) {
 		    /* Successful, assume this is a CHS disk */
 		    disk->rdwr_sectors = chs_rdwr_sectors;



More information about the Syslinux-commits mailing list