Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Aug 2002 06:00:15 -0700 (PDT)
From:      "Artem 'Zazoobr' Ignatjev" <timon@memphis.mephi.ru>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/20633: fdisk doesn't handle LBA correctly
Message-ID:  <200208161300.g7GD0F30086054@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/20633; it has been noted by GNATS.

From: "Artem 'Zazoobr' Ignatjev" <timon@memphis.mephi.ru>
To: freebsd-gnats-submit@FreeBSD.org, sjr@home.com
Cc:  
Subject: Re: bin/20633: fdisk doesn't handle LBA correctly
Date: Fri, 16 Aug 2002 16:56:01 +0400

 	Hi, if I understand what jhb said in audit trail, following patch
 should solve the issue. Stephen, if it still bothers you, could you try
 it?
 
 --- sbin/i386/fdisk/fdisk.c	Fri Aug 16 16:24:27 2002
 +++ sbin/i386/fdisk/fdisk.c	Fri Aug 16 16:33:28 2002
 @@ -468,13 +468,21 @@
  		part_mb,
  		partp->dp_flag,
  		partp->dp_flag == ACTIVE ? " (active)" : "");
 -	printf("\tbeg: cyl %d/ head %d/ sector %d;\n\tend: cyl %d/ head %d/ sector %d\n"
 -		,DPCYL(partp->dp_scyl, partp->dp_ssect)
 -		,partp->dp_shd
 -		,DPSECT(partp->dp_ssect)
 -		,DPCYL(partp->dp_ecyl, partp->dp_esect)
 -		,partp->dp_ehd
 -		,DPSECT(partp->dp_esect));
 +	/* 
 +	 * if C/H/S of start or end are all set to 0xff, then C/H/S don't have
 +	 * enough bits to hold the address, and one should use LBA instead.
 +	 */
 +	if ((partp->dp_scyl != 0xff || partp->dp_ssect != 0xff || 
 +		partp->dp_shd != 0xff) && (partp->dp_ecyl != 0xff || 
 +		partp->dp_esect != 0xff || partp->dp_ehd != 0xff))
 +		printf("\tbeg: cyl %d/ head %d/ sector %d;\n"
 +			"\tend: cyl %d/ head %d/ sector %d\n"
 +			,DPCYL(partp->dp_scyl, partp->dp_ssect)
 +			,partp->dp_shd
 +			,DPSECT(partp->dp_ssect)
 +			,DPCYL(partp->dp_ecyl, partp->dp_esect)
 +			,partp->dp_ehd
 +			,DPSECT(partp->dp_esect));
  }
  
  
 			Sinceherely yours, Artem 'Zazoobr' Ignatjev.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200208161300.g7GD0F30086054>