[2009] in linux-scsi channel archive

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

Re: scsidisk I/O error: sector number display

daemon@ATHENA.MIT.EDU (Richard Waltham)
Sun Jun 15 12:57:15 1997

From: Richard Waltham <dormouse@farsrobt.demon.co.uk>
To: lnz@dandelion.com (Leonard N. Zubkoff)
Date: 	Sun, 15 Jun 1997 11:51:45 +0100 (BST)
Cc: linux-scsi@vger.rutgers.edu
In-Reply-To: <199706150157.SAA20568@dandelion.com> from "Leonard N. Zubkoff" at Jun 14, 97 06:57:01 pm

Leonard N. Zubkoff wrote:
> 
>   From: Richard Waltham <dormouse@farsrobt.demon.co.uk>
>   Date: Sat, 14 Jun 1997 20:13:57 +0100 (BST)
> 
>   Fair enough... Now where do I find the start of the partition? Think I'll
>   stick with my patch.:)
> 
> Fdisk will tell you that, I believe.  I think adding the sector number in the
> underlying device makes sense, but as additional information, not as a
> replacement for the relative sector.
> 
> 		Leonard
> 

Sounds very reasonable and can be achieved by something like

----------------------------------------------------------------------------
--- linux/drivers/scsi/scsi.h.orig	Thu Jun 12 10:36:41 1997
+++ linux/drivers/scsi/scsi.h	Sun Jun 15 10:09:58 1997
@@ -218,6 +218,8 @@
 
 extern Scsi_Device * scsi_devices;
 
+extern struct hd_struct * sd;
+
 /*
  *  Initializes all SCSI devices.  This scans all scsi busses.
  */ 
@@ -498,8 +500,9 @@
     req = &SCpnt->request;
     req->errors = 0;
     if (!uptodate) {
-	printk(DEVICE_NAME " I/O error: dev %s, sector %lu\n",
-	       kdevname(req->rq_dev), req->sector);
+	printk(DEVICE_NAME " I/O error: dev %s, sector %lu, absolute sector %lu\n",
+	       kdevname(req->rq_dev), req->sector, 
+	       req->sector + sd[MINOR(SCpnt->request.rq_dev)].start_sect);
     }
     
     do {
----------------------------------------------------------------------------

... which gives a typical printout -

Jun 15 10:59:57 arak kernel: scsidisk I/O error: dev 08:13, sector 1281202, absolute sector 1445042


Richard

-- 
 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