[2000] in linux-scsi channel archive

home help back first fref pref prev next nref lref last post

scsidisk I/O error: sector number display

daemon@ATHENA.MIT.EDU (Richard Waltham)
Sat Jun 14 08:13:44 1997

From: Richard Waltham <dormouse@farsrobt.demon.co.uk>
To: linux-scsi@vger.rutgers.edu, linux-kernel@vger.rutgers.edu
Date: 	Sat, 14 Jun 1997 12:27:01 +0100 (BST)

Hi,

When displaying "scsidisk I/O error:" messages after medium errors and 
other errors with valid sense information the sector number displayed 
didn't make much sense to me until I realised it was the sector number 
from the start of the partition, not the start of the physical drive.
Effectively a relative value, OK if the error is on the first partition but
not much use, IMHO, if on any other partition of a drive.

Is this the intended display or is it intended to be the physical sector
number?

The following patch against 2.0.29 displays the logical? as opposed to 
the relative sector number.

Richard

------------------------------------------------------------------------
--- linux/drivers/scsi/scsi.h~	Wed May 28 21:01:15 1997
+++ linux/drivers/scsi/scsi.h	Wed May 28 21:00:45 1997
@@ -218,6 +218,8 @@
 
 extern Scsi_Device * scsi_devices;
 
+extern struct hd_struct * sd;
+
 /*
  *  Initializes all SCSI devices.  This scans all scsi busses.
  */ 
@@ -499,7 +501,7 @@
     req->errors = 0;
     if (!uptodate) {
 	printk(DEVICE_NAME " I/O error: dev %s, sector %lu\n",
-	       kdevname(req->rq_dev), req->sector);
+	       kdevname(req->rq_dev), req->sector + sd[MINOR(SCpnt->request.rq_dev)].start_sect);
     }
     
     do {
------------------------------------------------------------------------

-- 
 Richard Waltham   |               Work: richard@digtalinterface.demon.co.uk
   At home in      |               Home:       dormouse@farsrobt.demon.co.uk
 Southampton UK    |                                  Compuserve 100421.1276

home help back first fref pref prev next nref lref last post