public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [Patch] sg: fix device number in blktrace data
@ 2009-01-30 14:46 Martin Peschke
  2009-01-30 16:24 ` Douglas Gilbert
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Peschke @ 2009-01-30 14:46 UTC (permalink / raw)
  To: dgilbert; +Cc: Jens Axboe, linux-scsi

Hi,

we have run into an issue with blktrace being started for sg devices.
Please apply.

Thanks,
Martin



From: Martin Peschke <mpeschke@linux.vnet.ibm.com>

The device number denoting a generic SCSI devices (sg) in a blktrace
trace is broken; major and minor are always 0. It looks like
sdp->device->sdev_gendev.devt is not initialized properly.
The fix below uses other data to make up a valid device number,
similar to the way an sg device number is generated for sysfs output.

Reported-by: Stefan Raspl <raspl@linux.vnet.ibm.com>
Signed-off-by: Martin Peschke <mpeschke@linux.vnet.ibm.com>

---
 drivers/scsi/sg.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -1078,7 +1078,7 @@ sg_ioctl(struct inode *inode, struct fil
 	case BLKTRACESETUP:
 		return blk_trace_setup(sdp->device->request_queue,
 				       sdp->disk->disk_name,
-				       sdp->device->sdev_gendev.devt,
+				       MKDEV(SCSI_GENERIC_MAJOR, sdp->index),
 				       (char *)arg);
 	case BLKTRACESTART:
 		return blk_trace_startstop(sdp->device->request_queue, 1);



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-01-30 16:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-30 14:46 [Patch] sg: fix device number in blktrace data Martin Peschke
2009-01-30 16:24 ` Douglas Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox